Jump to: navigation, search

Blueprint-aws-vpc-support

Revision as of 20:53, 13 August 2013 by Rudrarugge (talk | contribs) (2.1 CreateVpc)

1. Overview

Grizzly release of Openstack, supports EC2 API translation to Nova, Quantum, Keystone calls. Using EC2 APIs user can launch VMs, assign IP addresses to VMs and so on. This blueprint enhances the EC2 APIs to support the amazon VPC APIs.

2. VPC maps to Openstack Project

VPC represents a virtual private cloud. It’s a container where all the networking resides – subnets, security groups, instance association to subnets, DHCP configuration, routing tables, gateway (vpn, nat, regular).

VPC would closely match to a Project in Openstack. Project is a container for all the items listed in a VPC. VPC level cidr_block would need to be stored in the project – this information is passed through to the relevant plugins.

2.1 CreateVpc

Request contains CidrBlock as required params.

InstanceTenancy as optional params

Return value is a VpcId and state of the VPC

In Openstack the request would translate into the following actions:

  • Create a unique id for the project such as vpc-a23aad23
  • Create the project with this name using keystone API
  • Use cidr_block then create an IPAM object in the project using Quantum API.
  • Use Quantum API to create default network ACL, default route table and default security group
  • Return VpcId and state as ‘available’ if all steps are successful


Reference: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateVpc.html

2.2 DescribeVpc

Optional params: vpcid and filters

Return value is all VPC related information [state, cidrblock, dhcp, etc]

In Openstack the request would translate into the following actions:

  • Use keystone APIs to fetch all project information
  • Apply filters to create list of only requested information
  • Return VPC details

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeVpc.html

2.3 DeleteVpc

Required params: vpcid

Return true if deleted else false

In Openstack the request would translate into the following actions:

  • Use keystone API to delete the project
  • Return true if successful else false

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteVpc.html

[1]

3. VPC Subnet maps to Openstack Network

Subnets in VPC are equivalent to defining networks with a cidr block.

3.1 CreateSubnet

Request contains VpcId and CidrBlock as required params

Return value is a SubnetId

In Openstack the request would translate into the following actions:

  • Select a UUID and map it to an VPC id such as subnet-abcd1234
  • Get the project based on the passed VpcId
  • Get the Network IPAM object for the project to read the VPC level CidrBlock.
  • Ensure that the passed subnet level CidrBlock is valid in the VPC level CidrBlock.
  • Use Quantum APIs to create a network with this SubnetId and CidrBlock
  • Return SubnetId and state as ‘available’ if all steps are successful

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateSubnet.html

3.2 DescribeSubnets

Optional params: subnetid and filters

Return value is all subnet related information [state, address-count]

In Openstack the request would translate into the following actions:

  • Use quantum APIs to read the networks
  • Return network information to be returned based on filters

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSubnets.html

3.3 DeleteSubnet

Required param: subnetid

Return value is true or false

In Openstack the request would translate into the following actions:

  • Use quantum APIs to get the list of networks
  • For each network map its UUID to subnetID and compare with passed subnetid.
  • If match succesful then delete network else return false.

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteSubnet.html

4. VPC DHCP Options maps to Openstack Network IPAM

These APIs are dependent on the Network IPam objects to be added at a domain level. Network IPAM object needs to be added to Quantum/Openstack. This can be done as part of this blueprint or a separate Network IPAM blueprint.

4.1 CreateDhcpOptions

Request contains DHCP key, value pairs as params

Return value is a DhcpOptionsId and list of options

In Openstack the request would translate into the following actions:

  • Create UUID and map to DhcpOptionsId such as dopt-abcd1234
  • Use Quantum APIs to create network IPAM with DHCP options. This network IPAM object can be created at the domain level.
  • Return DhcpOptionsId and list of DHCP options

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateDhcpOptions.html

[2]

4.2 AssociateDhcpOptions

Request contains DhcpOptionsId and VpcId to associate with

Return value is a DhcpOptionsId and list of options

In Openstack the request would translate into the following actions:

  • Get the project based on the passed VpcId
  • Get the network IPAM which contains the passed DhcpOptionsId
  • Associate these dhcp options to the project

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-AssociateDhcpOptions.html

4.3 DescribeDhcpOptions

Optional params: DhcpOptionsId and filters

Return value is a list of dhcp options information

In Openstack the request would translate into the following actions:

  • Use quantum API to get all dhcp options
  • Match based on filters and id
  • Return the list

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeDhcpOptions.html

4.4 DeleteDhcpOptions

Required param: DhcpOptionsId

Return value is true or false

In Openstack the request would translate into the following actions:

  • Use quantum APIs to get the list of ipams
  • For each ipam map its UUID to DhcpOptionsId and compare with passed DhcpOptionsId.
  • If match succesful then delete network else return false.

[3]

5. EC2 Instance API changes

EC2 Instance level APIs already exist in the Openstack Grizzly release. There is one change required to add support for launching instance with a particular VPC subnet.

5.1 RunInstances

Request contains one additional parameter called VPC SubnetId

Return value is regular response of RunInstances

In Openstack the request would translate into the following actions:

  • Get the VpcId/Project associated with the passed SubnetId
  • Get the Network associated with the associated SubnetId
  • Launch the VM/Instance with the Network

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-RunInstances.html

[4]

6. VPC Network ACL maps to Openstack Network Policy

These APIs map to the quantum APIs for network policy. This is currently work in progress and is supported via Quantum extensions

6.1 CreateNetworkAcl

Required param VpcId

Response contains NetworkAclId and ingress, egress default ACLs

In Openstack the request would translate into the following actions:

  • Get the Project based on VpcId
  • Create UUID and map to NetworkAclId such as acl-abcd1234
  • Use Quantum APIs to create network policy using name as NetworkAclId
  • Use Quantum APIs to add ingress and egress default rules with rule-id being 32767

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateNetworkAcl.html

6.2 DeleteNetworkAcl

Required param NetworkAclId

Response is true or false

In Openstack the request would translate into the following actions:

  • Check if NetworkPolicy is attached to a network
  • If still attached then return false
  • Else use Quantum API to delete the Network Policy based on NetworkAclId
  • Return true or false based on status

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteNetworkAcl.html

6.3 ReplaceNetworkAclAssociation

Required param AssociationId, NetworkAclId

Response is newAssociationId

In Openstack the request would translate into the following actions:

  • Use Quantum to read  the network policy based on NetworkAclId
  • Find the network based on AssociatedId that this policy is attached to. To do this we use network UUID as associated ID
  • Use Quantum to remove the policy attachment
  • Use Quantum to attach the new policy
  • Return the new association ID

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteNetworkAcl.html

[5]

6.4 CreateNetworkAclEntry

Required params: NetworkAclId, RuleNumber, 5-tuple , direction

Response status with true or false

In Openstack the request would translate into the following actions:

  • Use Quantum to get  the Network Policy using NetworkAclId
  • Use Quantum APIs to read all the rules in the Network Policy.
  • Insert the new rule at the correct location based on rule-number
  • Write the complete list of rules back in the NetworkPolicy
  • Return true if successful else false

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateNetworkAclEntry.html

6.5 DeleteNetworkAclEntry

Required params: NetworkAclId, RuleNumber

Optional params: Egress

Response status with true or false

In Openstack the request would translate into the following actions:

  • Use Quantum to get  the Network Policy using NetworkAclId
  • Use Quantum APIs to read all the rules in the Network Policy.
  • Delete the rule that matches the rule number. If egress is specified then delete only egress rule else delete ingress rule
  • Write the complete list of rules back in the NetworkPolicy
  • Return true if successful else false

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DeleteNetworkAclEntry.html

6.6 ReplaceNetworkAclEntry

Required params: NetworkAclId, RuleNumber, 5 tuple, direction

Response status with true or false

In Openstack the request would translate into the following actions:

  • Use Quantum to get  the Network Policy using NetworkAclId
  • Use Quantum APIs to read all the rules in the Network Policy.
  • Update the rule that matches the rule number with the new information
  • Write the complete list of rules back in the NetworkPolicy
  • Return true if successful else false

Reference:  http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-ReplaceNetworkAclEntry.html

7. VPC Allocate Address maps to Openstack Floating IPs

All VPC address APIs map to the Openstack floating IP APIs. These APIs have been enhanced by Amazon for VPC support in addition to the pre-existing EC2 support. When domain is passed as VPC then we will use Quantum floating IP APIs.

In addition administrator needs to pre-provision a network which can be used as a floating IP pool.

7.1 AllocateAddress

Required params: Domain - vpc

Response contains FloatingIP

In Openstack the request would translate into the following actions:

  • Use Quantum APIs to get the list of networks
  • For each network compare network name with “public” to get public network of FloatingIP.
  • If match successful then use Quantum API to create a FloatingIP from public network pool.
  • Return FloatingIP if successful else return Exception

Reference:

http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-AllocateAddress.html

7.2 ReleaseAddress

Required params: AllocationId or FloatingIp

Response is true or false

In Openstack the request would translate into the following actions:

  • Use Quantum APIs to get the list of Floating IPs
  • For each Floating IP If AllocationId is given then map the FloatingIp uuid to AllocationId and compare with given AllocationId else If FloatingIp is given compare it with FloatingIp
  • If match successful then use Quantum API to delete the FloatingIp from public network pool.
  • Return true if successful else exception

Reference:

http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-ReleaseAddress.html

7.3 AssociateAddress

Required params: InstanceId, AllocationId or FloatingIp

Response is AllocationId

In Openstack the request would translate into the following actions:

  • Map the given InstanceId to Instance uuid using ec2utils
  • Use Compute APIs to fetch list of fixed Ips for using Instance uuid
  • If multiple fixed IPs select the first fixed IP
  • Use Quantum APIs to get the list of Floating IPs
  • For each Public IP If AllocationId is given then map the FloatingIp uuid to AllocationId and compare with given AllocationId else If FloatingIp is given compare it with FloatingIp
  • Use Quantum APIs to get the list of Ports using for the given instance using Instance uuid
  • Use Quantum APIs to associate FloatingIp to all fetched ports
  • Use ec2utils to generate AssociationId from FloatingIp uuid
  • Return Association if successful else exception

Reference:

http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-AssociateAddress.html

7.4 DisassociateAddress

Required params: AllocationId or FloatingIp

Response is true or false

In Openstack the request would translate into the following actions:

  • Use Quantum APIs to get the list of Floating IPs
  • For each FloatingIp If AllocationId is given then map the FloatingIp uuid to AllocationId and compare with given AllocationId else If FloatingIp is given compare it with FloatingIp
  • If match successful then use Quantum API to update the FloatingIp ports to None to disassociate FloatingIp
  • Return true if successful else exception

Reference:

http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DisassociateAddress.html

7.5 DescribeAddress

Optional params: FloatingIp and filters

Return value is a list of Floating IP information

In Openstack the request would translate into the following actions:

  • Use quantum API to get all FloatingIP
  • Match based on filters and id
  • Return the list

Reference:

http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeAddresses.html

8. VPC Security Group maps to Openstack Security Group

All VPC security group APIs map to the Openstack security group APIs. A default security group is created when a VPC is created. All instances are associated with the default security group until the association is changed.

Amazon passed the keywork EC2-VPC for calls that need to be handled by Quantum.

8.1 CreateSecurityGroup

8.2 DescribeSecurityGroups

8.3 DeleteSecurityGroup

8.4 AuthoriseSecurityGroupIngress

8.5 RevokeSecurityGroupIngress

8.6 AuthoriseSecurityGroupEgress

8.7 RevokeSecurityGroupEgress

8.8 DescribeSecurityGroup

8.9 RunInstances

9. VPC route table [new changes needed in Openstack]

9.1 CreateRouteTable

9.2 DescribeRouteTables

9.3 DeleteRouteTable

9.4 ReplaceRouteTableAssociation

9.5 DisassociateRouteTable

9.6 CreateRoute

9.7 DeleteRoute

9.8 ReplaceRoute