Package: ec2-api
Support of EC2 API for OpenStack.
This project provides a standalone EC2 API service which pursues two goals:Implement VPC APICreate a standalone service for EC2 API support.InstallationFor more detailed information, please see theInstallation Guide.Installation by install.shRun install.shThe EC2 API service gets installed on port 8788 by default. It can be changed
before the installation in install.sh script.The services afterwards can be started as binaries:/usr/local/bin/ec2-api
/usr/local/bin/ec2-api-metadata
/usr/local/bin/ec2-api-s3or set up as Linux services.Configuring OpenStack for EC2 API metadata service refering to section “EC2 metadata Configuration”.Installation on devstackInstallation in devstack:In order to install ec2-api with devstack the following should be added to
the local.conf or localrc the following line:enable_plugin ec2-api https://opendev.org/openstack/ec2-apiDevstack installation with ec2-api and ec2api-tempest-plugin for development:install packages: awscli, git, python3, python3-devel, rubyclone devstack repositorygit clone https://opendev.org/openstack/devstackgrant all permissions for your user for directory: “/opt”create folder “/opt/stack/logs/”clone repository “ec2api-tempest-plugin” to stack folder:git clone https://github.com/openstack/ec2api-tempest-plugin /opt/stack/ec2api-tempest-plugincreate local.conf:[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
enable_plugin ec2-api https://opendev.org/openstack/ec2-api
enable_plugin neutron-tempest-plugin https://github.com/openstack/neutron-tempest-plugin
TEMPEST_PLUGINS='/opt/stack/ec2api-tempest-plugin'go to devstack folder and start installationcd ~/devstack/
./stack.shcheck installed devstacksource ~/devstack/accrc/admin/admin
tempest list-plugins
ps -aux | grep "ec2"
aws --endpoint-url http://<IP-ADDRESS> --region <REGION> --profile admin ec2 describe-images
openstack catalog list
openstack flavor list
openstack image list
sudo journalctl -u devstack@ec2-api.servicerun integration tests (ec2 tempest test)cd /opt/stack/tempest
tox -eall -- ec2api_tempest_plugin --concurrency 1
tox -eall ec2api_tempest_plugin.api.test_network_interfaces.NetworkInterfaceTest.test_create_max_network_interfacerun ec2-api unit testscd /opt/stack/ec2-api
tox -epy36 ec2api.tests.unit.test_security_group.SecurityGroupTestCase.test_describe_security_groups_no_default_vpcConfiguring OpenStack for EC2 API metadata service refering to section “EC2 metadata Configuration”.EC2 metadata ConfigurationTo configure OpenStack for EC2 API metadata service:for Nova-networkadd:[DEFAULT]
metadata_port = 8789
[neutron]
service_metadata_proxy = Trueto /etc/nova.confthen restart nova-metadata (can be run as part of nova-api service) and
nova-network services.for Neutronadd:[DEFAULT]
nova_metadata_port = 8789to /etc/neutron/metadata_agent.ini for legacy neutron or
to neutron_ovn_metadata_agent.ini for OVNthen restart neutron-metadata service.S3 server is intended only to support EC2 operations which require S3 server
(e.g. CreateImage) in OpenStack deployments without regular object storage.
It must not be used as a substitution for all-purposes object storage server.
Do not start it if the deployment has its own object storage or uses a public
one (e.g. AWS S3).UsageDownload aws cli from Amazon.
Create configuration file for aws cli in your home directory ~/.aws/config:[default]
aws_access_key_id = 1b013f18d5ed47ae8ed0fbb8debc036b
aws_secret_access_key = 9bbc6f270ffd4dfdbe0e896947f41df3
region = us-east-1Change the aws_access_key_id and aws_secret_acces_key above to the values
appropriate for your cloud (can be obtained by “openstack ec2 credentials list”
command).Run aws cli commands using new EC2 API endpoint URL (can be obtained from
openstack cli with the new port 8788) like this:aws –endpoint-urlhttp://10.0.2.15:8788ec2 describe-instancesSupported Features and LimitationsGeneral:DryRun option is not supported.Some exceptions are not exactly the same as reported by AWS.AWS
ComponentCommandFunctionality
groupLimitationsbold- supported, normal - supported
with limitations,italic-not supportedVPCAcceptVpcPeeringConnectioncross-VPC
connectivitynot supportedEC2, VPCAllocateAddressaddressesAllocateHostsdedicated hostsnot supportedAssignIpv6Addressesnetwork
interfacesnot supportedVPCAssignPrivateIpAddressesnetwork
interfacesallowReassignment parameterEC2, VPCAssociateAddressaddressesVPCAssociateDhcpOptionsDHCP optionsVPCAssociateRouteTableroutesAssociateSubnetCidrBlocksubnetsnot supportedAssociateVpcCidrBlockVPCnot supportedVPCAttachClassicLinkVpccross-VPC
connectivitynot supportedVPCAttachInternetGatewayinternet
gatewaysVPCAttachNetworkInterfacenetwork
interfacesEC2, EBSAttachVolumevolumesVPCAttachVpnGatewayVPNEC2, VPCAuthorizeSecurityGroupEgresssecurity groupsEC2 classic way to pass cidr, protocol,
sourceGroup, ports parametersEC2, VPCAuthorizeSecurityGroupIngresssecurity groupsEC2 classic way to pass cidr, protocol,
sourceGroup, ports parametersBundleInstancetasks,s3not supportedCancelBundleTasktasks,s3not supportedCancelConversionTasktasks,s3not supportedCancelExportTasktasks,s3not supportedCancelImportTasktasks,s3not supportedCancelReservedInstancesListingmarketnot supportedCancelSpotFleetRequestsmarketnot supportedCancelSpotInstanceRequestsmarketnot supportedConfirmProductInstanceproduct codesnot supportedEBSCopyImageimage
provisioningnot supportedEBSCopySnapshotsnapshots,s3not supportedVPCCreateCustomerGatewayVPC gatewaysBGPdynamicroutingVPCCreateDhcpOptionsDHCP optionsCreateEgressOnlyInternetGatewayVPC gatewaysnot supportedCreateFlowLogsinfrastructuralnot supportedEBSCreateImageimagesblockDeviceMapping parameterCreateInstanceExportTasktasks,s3not supportedVPCCreateInternetGatewayVPC gatewaysEC2CreateKeyPairkey pairsCreateNatGatewayNAT gatewaysnot supportedVPCCreateNetworkAclACLnot supportedVPCCreateNetworkAclEntryACLnot supportedVPCCreateNetworkInterfacenetwork
interfacesCreatePlacementGroupclustersnot supportedCreateReservedInstancesListingmarketnot supportedVPCCreateRouteroutesvpcPeeringConnection parameterVPCCreateRouteTableroutesEC2, VPCCreateSecurityGroupsecurity groupsEBSCreateSnapshotsnapshotsCreateSpotDatafeedSubscriptionmarketnot supportedVPCCreateSubnetsubnetsavailabilityZone parameterEC2CreateTagstagsEBSCreateVolumevolumesiops, encrypted, kmsKeyId parametersVPCCreateVpcVPCVPCCreateVpcEndpointcross-VPC
connectivitynot supportedVPCCreateVpcPeeringConnectioncross-VPC
connectivitynot supportedVPCCreateVpnConnectionVPNBGP dynamic routingVPCCreateVpnConnectionRouteVPNVPCCreateVpnGatewayVPNBGP dynamic routingVPCDeleteCustomerGatewayVPC gatewaysVPCDeleteDhcpOptionsDHCP optionsDeleteEgressOnlyInternetGatewayVPC gatewaysnot supportedDeleteFlowLogsinfrastructuralnot supportedVPCDeleteInternetGatewayVPC gatewaysEC2DeleteKeyPairkey pairsDeleteNatGatewayNAT gatewaysnot supportedVPCDeleteNetworkAclACLnot supportedVPCDeleteNetworkAclEntryACLnot supportedVPCDeleteNetworkInterfacenetwork
interfacesEC2DeletePlacementGroupclustersnot supportedVPCDeleteRouteroutesVPCDeleteRouteTableroutesEC2, VPCDeleteSecurityGroupsecurity groupsEBSDeleteSnapshotsnapshotsDeleteSpotDatafeedSubscriptionmarketnot supportedVPCDeleteSubnetsubnetsEC2DeleteTagstagsEBSDeleteVolumevolumesVPCDeleteVpcVPCVPCDeleteVpcEndpointscross-VPC
connectivitynot supportedVPCDeleteVpcPeeringConnectioncross-VPC
connectivitynot supportedVPCDeleteVpnConnectionVPNVPCDeleteVpnConnectionRouteVPNVPCDeleteVpnGatewayVPNEBSDeregisterImageimagesEC2DescribeAccountAttributesinfrastructuralvpc-max-security-groups-per-interface,
max-elastic-ips,
vpc-max-elastic-ips attributesEC2, VPCDescribeAddressesaddressesEC2DescribeAvailabilityZonesavailability
zonesDescribeBundleTaskstasks,s3not supportedVPCDescribeClassicLinkInstancescross-VPC
connectivitynot supportedDescribeConversionTaskstasks,s3not supportedVPCDescribeCustomerGatewaysgatewaysVPCDescribeDhcpOptionsDHCP optionsDescribeEgressOnlyInternetGatewaysVPC gatewaysnot supportedDescribeExportTaskstasks,s3not supportedDescribeFlowLogsinfrastructuralnot supportedDescribeHostsdedicated hostsnot supportedDescribeIdentityIdFormatresource IDsnot supportedDescribeIdFormatresource IDsnot supportedEBSDescribeImageAttributeimagesproductCodes, sriovNetSupport
attributesEBSDescribeImagesimagesDescribeImportImageTaskstasks,s3not supportedDescribeImportSnapshotTaskstasks,s3not supportedEC2DescribeInstanceAttributeinstancessame limitations as for
ModifyInstanceAttributeEC2,
EBS, VPCDescribeInstancesinstancesDescribeInstanceStatusmonitoringnot supportedVPCDescribeInternetGatewaysgatewaysEC2DescribeKeyPairskey pairsVPCDescribeMovingAddressesinfrastructuralnot supportedDescribeNatGatewaysNAT gatewaysnot supportedVPCDescribeNetworkAclsACLnot supportedVPCDescribeNetworkInterfaceAttributenetwork
interfacesVPCDescribeNetworkInterfacesnetwork
interfacesEC2DescribePlacementGroupsclustersnot supportedVPCDescribePrefixListscross-VPC
connectivitynot supportedEC2DescribeRegionsavailability
zonesRegionNameparameterDescribeReservedInstancesmarketnot supportedDescribeReservedInstancesListingsmarketnot supportedDescribeReservedInstancesModificationsmarketnot supportedDescribeReservedInstancesOfferingsmarketnot supportedVPCDescribeRouteTablesroutesDescribeScheduledInstanceAvailabilityscheduled
instancesnot supportedDescribeScheduledInstancesscheduled
instancesnot supportedDescribeSecurityGroupReferencessecurity groupsnot supportedEC2, VPCDescribeSecurityGroupssecurity groupscidr, protocol, port, sourceGroup
parametersEBSDescribeSnapshotAttributesnapshotsnot supportedEBSDescribeSnapshotssnapshotsDescribeSpotDatafeedSubscriptionmarketnot supportedDescribeSpotFleetInstancesmarketnot supportedDescribeSpotFleetRequestHistorymarketnot supportedDescribeSpotFleetRequestsmarketnot supportedDescribeSpotInstanceRequestsmarketnot supportedDescribeSpotPriceHistorymarketnot supportedDescribeStaleSecurityGroupssecurity groupsnot supportedVPCDescribeSubnetssubnetsEC2DescribeTagstagsEBSDescribeVolumeAttributevolumesnot supportedEBSDescribeVolumesvolumesDescribeVolumeStatusmonitoringnot supportedVPCDescribeVpcAttributeVPCnot supportedVPCDescribeVpcClassicLinkcross-VPC
connectivitynot supportedDescribeVpcClassicLinkDnsSupportcross-VPC
connectivitynot supportedVPCDescribeVpcEndpointscross-VPC
connectivitynot supportedVPCDescribeVpcEndpointServicescross-VPC
connectivitynot supportedVPCDescribeVpcPeeringConnectionscross-VPC
connectivitynot supportedVPCDescribeVpcsVPCVPCDescribeVpnConnectionsVPNVPCDescribeVpnGatewaysVPNVPCDetachClassicLinkVpccross-VPC
connectivitynot supportedVPCDetachInternetGatewayVPCVPCDetachNetworkInterfacenetwork
interfacesEC2, EBSDetachVolumevolumesinstance_id, device, force parametersVPCDetachVpnGatewayVPNVPCDisableVgwRoutePropagationVPNVPCDisableVpcClassicLinkcross-VPC
connectivitynot supportedDisableVpcClassicLinkDnsSupportcross-VPC
connectivitynot supportedEC2, VPCDisassociateAddressaddressesVPCDisassociateRouteTableDisassociateSubnetCidrBlockroutes
subnetsnot supportedDisassociateVpcCidrBlockVPCnot supportedVPCEnableVgwRoutePropagationVPNEBSEnableVolumeIOmonitoringnot supportedVPCEnableVpcClassicLinkcross-VPC
connectivitynot supportedEnableVpcClassicLinkDnsSupportcross-VPC
connectivitynot supportedEC2GetConsoleOutputinstancesGetConsoleScreenshotinstancesnot supportedEC2GetPasswordDatainstancesImportImagetasks,s3not supportedImportInstancetasks,s3not supportedEC2ImportKeyPairkeypairsImportSnapshottasks,s3not supportedImportVolumetasks,s3not supportedModifyHostsdedicated hostsnot supportedModifyIdentityIdFormatresource IDsnot supportedModifyIdFormatresource IDsnot supportedEBSModifyImageAttributeimagesproductCodes attributeEC2ModifyInstanceAttributeinstancesonly disableApiTermination,
sourceDestCheck,instanceType supportedModifyInstancePlacementdedicated hostsnot supportedVPCModifyNetworkInterfaceAttributenetwork
interfacesModifyReservedInstancesmarketnot supportedEBSModifySnapshotAttributesnapshotsnot supportedModifySpotFleetRequestmarketnot supportedVPCModifySubnetAttributesubnetsnot supportedEBSModifyVolumeAttributevolumesnot supportedVPCModifyVpcAttributeVPCnot supportedVPCModifyVpcEndpointcross-VPC
connectivitynot supportedModifyVpcPeeringConnectionOptionscross-VPC
connectivitynot supportedMonitorInstancesmonitoringnot supportedVPCMoveAddressToVpcinfrastructuralnot supportedPurchaseReservedInstancesOfferingmarketnot supportedPurchaseScheduledInstancesscheduled
instancesnot supportedEC2RebootInstancesinstancesEBSRegisterImageimagesvirtualizationType, sriovNetSupport
parametersVPCRejectVpcPeeringConnectioncross-VPC
connectivitynot supportedEC2, VPCReleaseAddressaddressesReleaseHostsdedicated hostsnot supportedVPCReplaceNetworkAclAssociationACLnot supportedVPCReplaceNetworkAclEntryACLnot supportedVPCReplaceRouteroutesVPCReplaceRouteTableAssociationroutesReportInstanceStatusmonitoringnot supportedRequestSpotFleetmarketnot supportedRequestSpotInstancesmarketnot supportedEBSResetImageAttributeimagesEC2ResetInstanceAttributeinstancessame limitations as for
ModifyInstanceAttributeVPCResetNetworkInterfaceAttributenetwork
interfacesEBSResetSnapshotAttributesnapshotsnot supportedVPCRestoreAddressToClassicinfrastructuralnot supportedEC2, VPCRevokeSecurityGroupEgresssecurity groupsEC2 classic way to pass cidr, protocol,
sourceGroup, ports parametersEC2, VPCRevokeSecurityGroupIngresssecurity groupsEC2 classic way to pass cidr, protocol,
sourceGroup, ports parametersEC2,
VPC, EBSRunInstancesinstancesplacement, block_device_mapping partial
support, monitoring,
iamInstanceProfile, ebsOptimized,
shutdownInitiatedInstanceBehavior
parametersRunScheduledInstancesscheduled
instancesnot supportedEC2StartInstancesinstancesEC2StopInstancesinstancesEC2TerminateInstancesinstancesUnassignIpv6Addressesnetwork
interfacesnot supportedVPCUnassignPrivateIpAddressesnetwork
interfacesUnmonitorInstancesmonitoringnot supportedReferencesDocumentation:https://docs.openstack.org/ec2-api/latest/Wiki:https://wiki.openstack.org/wiki/EC2APIBugs:https://launchpad.net/ec2-apiSource:https://opendev.org/openstack/ec2-apiBlueprint:https://blueprints.launchpad.net/nova/+spec/ec2-apiSpec:https://review.opendev.org/#/c/147882/