InstallAnywhere 2020
You can use command-line tools to deploy an Amazon EC2 virtual appliance.
To deploy an Amazon EC2 virtual appliance on demand through command-line tools:
1. | Make sure that the Amazon ec2-ami-tools and ec2-api-tools packages are installed on your host machine. |
2. | Copy the .ami files to the host machine. |
3. | Use the ec2-bundle-image command to split this file into bundles: |
$> ec2-bundle-image -i <Location_Of_AMI> --cert <Path_To_X509_Certficate> --privatekey <Path_To_Private_Key> -u <AWS_Account_number>
Note • This requires that the ec2-api-tools are installed.
This process will split your AMI into a set of 10 MB segments and also provide a manifest XML file.
4. | Upload these files/bundles on to the Amazon cloud using ec2-upload-bundle by providing relevant parameters related to your account on Amazon: |
$> ec2-upload-bundle -b <Name_Of_Amazon_S3_Bucket> -m <Location_Of_Amazon_Bundle_Manifest_XML_File> -a <Amazon_Access_Key> -s <Amazon_Secret_Key>
5. | Once these files are uploaded, you need to register the files as an AMI (Amazon Machine Image) by using the following command: |
$> ec2-register <your-s3-bucket>/<image.manifest.xml>
This process will write an AMI-ID to your command prompt.
Note • The ec2-register, ec2-create-keypair, and ec2-launch-instance has a GUI version using Amazon Web Services (AWS) Management Console.
6. | To access this image, once hosted on the Amazon infrastructure, you need to have a key-pair. To create a key‑pair, use the ec2-create-keypair command: |
$> ec2-create-keypair <keyName> --aws-access-key <Amazon_Access_Key> --aws-secret-key <Amazon_Secret_Key>
This process will create a key-pair, store the public key of the key-pair with the Amazon EC2, and the private key is displayed in the console.
7. | Copy the generated (/displayed) key-pair key to a plain text file and store it with the extension .pem. |
8. | You can now launch the appliance using the ec2-run-instances command: |
$> ec2-run-instances $<Amazon_AMI_ID> -k <pathToKeyPair> -n <number of instances> [-z <Amazon_Availability_Zone> ] --kernel $kernel_id --aws-access-key <Amazon_Access_Key> --aws-secret-key <Amazon_Secret_Key>
The kernel ID corresponding to your image can be located by looking at the AKI-ID column in the AMI locator hosted at http://cloud.ubuntu.com/ami/.
Tip • For a sample project, see Using the IABookstore Sample for Creating Virtual Appliances.
InstallAnywhere 2020 Help LibraryOctober 2019 |
Copyright Information | Flexera |