{"id":2283,"date":"2018-03-23T18:06:50","date_gmt":"2018-03-23T22:06:50","guid":{"rendered":"http:\/\/blog.domb.net\/?p=2283"},"modified":"2018-03-29T08:27:38","modified_gmt":"2018-03-29T12:27:38","slug":"cloudforms-in-aws-part-1","status":"publish","type":"post","link":"https:\/\/blog.domb.net\/?p=2283","title":{"rendered":"CloudForms in AWS part 1"},"content":{"rendered":"<p>Ever wondered what CloudForms can do for you in AWS? The next few blog posts will walk you through step by step how to upload the CloudForms image to AWS, how to assign the correct policies and roles and how to configure it correctly so it can discover your environment. Part 1 is dedicated to the import and configuration of the CloudForms image.<\/p>\n<p><span style=\"font-weight: 400\">With the release of <strong>CloudForms <\/strong>4.6 you also have the ability to scan instances in AWS. These blog series will show you how this can be achieved: <\/span><\/p>\n<p><span style=\"font-weight: 400\">First, go to the AWS console and launch a free tier amazon AMI. We are doing this because it already has the aws cli tools installed.<\/span>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2288\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.35.27-PM.png\" alt=\"\" width=\"912\" height=\"443\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.35.27-PM.png 912w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.35.27-PM-300x146.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.35.27-PM-768x373.png 768w\" sizes=\"auto, (max-width: 912px) 100vw, 912px\" \/><\/p>\n<p><span style=\"font-weight: 400\">In the ec2 web console attach the admin IAM role for this instance (you can delete the instance after setup)<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2287\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.36.49-PM.png\" alt=\"\" width=\"942\" height=\"329\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.36.49-PM.png 942w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.36.49-PM-300x105.png 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.36.49-PM-768x268.png 768w\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" \/><\/p>\n<p><span style=\"font-weight: 400\">This will open the following window. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Assign the admin role and apply. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Your instance should be up by now. Go and ssh into it (don&#8217;t worry my private key was a one time key). <\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2286\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.38.04-PM.png\" alt=\"\" width=\"727\" height=\"514\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.38.04-PM.png 727w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-4.38.04-PM-300x212.png 300w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><\/p>\n<pre class=\"lang:default decode:true\">ssh -i \"ldombprivate.pem\" ec2-user@ec2-54-160-180-77.compute-1.amazonaws.com\r\n\r\n<\/pre>\n<p><span style=\"font-weight: 400\">The next step will be to configure the cli for the correct region. As we assigned an IAM role you won\u2019t need to add any credentials. <\/span><\/p>\n<pre class=\"lang:default decode:true\">[ec2-user@ip-172-31-14-85 ~]$ aws configure\r\n\r\nAWS Access Key ID [None]:\r\n\r\nAWS Secret Access Key [None]:\r\n\r\nDefault region name [None]: us-east-1\r\n\r\nDefault output format [None]:<\/pre>\n<p><span style=\"font-weight: 400\">Login into the Red Hat Portal and get the Amazon VHD<\/span><\/p>\n<pre class=\"lang:default decode:true \">wget \"https:\/\/access.cdn.redhat.com\/\/content\/origin\/files\/sha256\/18\/18d7f11b2163f4cd894f4683394d9723102342a73212c68e97461469788b72e9\/cfme-ec2-5.9.0.22-1.x86_64.vhd?_auth_=1520802709_a5f94e34e15f6b286e4a129392c06c44\" -O cfme-ec2-5.9.0.22-1.x86_64.vhd<\/pre>\n<p><span style=\"font-weight: 400\">The next step is to create an S3 bucket where we can upload the VHD to later be converted into an ami<\/span><\/p>\n<pre class=\"lang:default decode:true \">[ec2-user@ip-172-31-14-85 ~]$\u00a0aws s3 mb s3:\/\/awscfme59<\/pre>\n<p><span style=\"font-weight: 400\">Before we copy any file it&#8217;s important to understand that S3 does not have a private endpoint. Thus you would copy the vhd via the internet. If you want to speed things up you can go to your VPC and create an s3 endpoint. This will speed up the upload of the VHD to the s3 bucket. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Lets copy the <\/span><span style=\"font-weight: 400\">cfme-ec2-5.9.0.22-1.x86_64.vhd to the s3 bucket. If you enabled the endpoint you should see speeds like the following:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2285\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-7.17.13-PM.png\" alt=\"\" width=\"685\" height=\"51\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-7.17.13-PM.png 685w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-7.17.13-PM-300x22.png 300w\" sizes=\"auto, (max-width: 685px) 100vw, 685px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Once completed you will see the following: <\/span><\/p>\n<pre class=\"lang:default decode:true \">[ec2-user@ip-172-31-14-85 ~]$ aws s3 cp cfme-ec2-5.9.0.22-1.x86_64.vhd s3:\/\/awscfme59\/\r\n\r\nupload: .\/cfme-ec2-5.9.0.22-1.x86_64.vhd to s3:\/\/awscfme59\/cfme-ec2-5.9.0.22-1.x86_64.vhd<\/pre>\n<p><span style=\"font-weight: 400\">If you have never imported a VM in aws you will need to add the following VM import trust policy. Create a file named <\/span><span style=\"font-weight: 400\">vm-import.json with the following content: <\/span><span style=\"font-weight: 400\">\u00a0<\/span><\/p>\n<pre class=\"lang:js decode:true\">{\r\n\u00a0\u00a0\"Version\": \"2012-10-17\",\r\n\u00a0\u00a0\"Statement\": [\r\n\u00a0\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Effect\": \"Allow\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Principal\": { \"Service\": \"vmie.amazonaws.com\" },\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Action\": \"sts:AssumeRole\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Condition\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"StringEquals\":{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"sts:Externalid\": \"vmimport\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0]\r\n}\r\n\r\n\r\n\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Go ahead and create the trust policy for the role vmimport:<\/span><\/p>\n<pre class=\"lang:js decode:true\">[ec2-user@ip-172-31-16-233 ~]$ aws iam create-role --role-name vmimport --assume-role-policy-document file:\/\/vm-import.json\r\n\r\n{\r\n\r\n\u00a0\u00a0\u00a0\"Role\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"AssumeRolePolicyDocument\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Version\": \"2012-10-17\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Statement\": [\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Action\": \"sts:AssumeRole\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Effect\": \"Allow\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Condition\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"StringEquals\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"sts:Externalid\": \"vmimport\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Principal\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Service\": \"vmie.amazonaws.com\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"RoleId\": \"AROAJZLT6IXHOKY3S4OE2\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"CreateDate\": \"2018-03-09T22:46:31.581Z\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"RoleName\": \"vmimport\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Path\": \"\/\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Arn\": \"arn:aws:iam::XXXXXXXXX:role\/vmimport\"\r\n\u00a0\u00a0\u00a0}\r\n}\r\n\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Next, we will need to add the role policy to allow s3 to list the buckets as well as create the snapshot, convert and register the CloudForms ami AMI. Create a file named <\/span><span style=\"font-weight: 400\">role-policy.json<\/span><\/p>\n<pre class=\"lang:default decode:true \">{\r\n\u00a0\u00a0\"Version\":\"2012-10-17\",\r\n\u00a0\u00a0\"Statement\":[\r\n\u00a0\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Effect\":\"Allow\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Action\":[\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"s3:GetBucketLocation\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"s3:GetObject\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"s3:ListBucket\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0],\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Resource\":[\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"arn:aws:s3:::awscfme59\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"arn:aws:s3:::awscfme59\/*\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0},\r\n\u00a0\u00a0\u00a0\u00a0\u00a0{\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Effect\":\"Allow\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Action\":[\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"ec2:ModifySnapshotAttribute\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"ec2:CopySnapshot\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"ec2:RegisterImage\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"ec2:Describe*\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0],\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Resource\":\"*\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0]\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">Create the role policy for\u00a0vmimport<\/span><\/p>\n<pre class=\"lang:default decode:true\">[ec2-user@ip-172-31-16-233 ~]$ aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document file:\/\/role-policy.json<\/pre>\n<p><span style=\"font-weight: 400\">Before we can import the file we need to create one last file named container.json<\/span><\/p>\n<pre class=\"lang:default decode:true\">[\r\n\u00a0{\r\n\u00a0\"Description\": \"cfme5922\",\r\n\u00a0\"Format\": \"vhd\",\r\n\u00a0\"UserBucket\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"S3Bucket\": \"awscfme59\",\r\n\"S3Key\": \"cfme-ec2-5.9.0.22-1.x86_64.vhd\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0}\r\n]<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">Import CloudForms into your aws account. <\/span><\/p>\n<pre class=\"lang:default decode:true\">[ec2-user@ip-172-31-16-233 ~]$ aws ec2 import-image --description \"CFME 5.9.0.22\" --disk-containers file:\/\/container.json --region us-east-1\r\n{\r\n\u00a0\u00a0\u00a0\"Status\": \"active\",\r\n\u00a0\u00a0\u00a0\"Description\": \"CFME 5.9.0.22\",\r\n\u00a0\u00a0\u00a0\"SnapshotDetails\": [\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"UserBucket\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"S3Bucket\": \"awscfme59\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"S3Key\": \"cfme-ec2-5.9.0.22-1.x86_64.vhd\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"DiskImageSize\": 0.0,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Format\": \"VHD\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0],\r\n\u00a0\u00a0\u00a0\"Progress\": \"2\",\r\n\u00a0\u00a0\u00a0\"StatusMessage\": \"pending\",\r\n\u00a0\u00a0\u00a0\"ImportTaskId\": \"import-ami-ffut8pit\"\r\n}\r\n\r\n<\/pre>\n<p><span style=\"font-weight: 400\">The StatusMessage will go from pending to converting to <\/span><span style=\"font-weight: 400\">updating<\/span><span style=\"font-weight: 400\">, booting, <\/span><span style=\"font-weight: 400\">preparing ami. <\/span><\/p>\n<p><span style=\"font-weight: 400\">You can view the status by executing the following command. <\/span><\/p>\n<pre class=\"lang:default decode:true\">[ec2-user@ip-172-31-16-233 ~]$ aws ec2 describe-import-image-tasks --import-task-ids import-ami-ffut8pit\r\n{\r\n\u00a0\u00a0\u00a0\"ImportImageTasks\": [\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Status\": \"active\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"LicenseType\": \"BYOL\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Description\": \"CFME 5.9.0.22\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Platform\": \"Linux\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Architecture\": \"x86_64\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"SnapshotDetails\": [\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"DeviceName\": \"\/dev\/sda1\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Description\": \"cfme5922\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Format\": \"VHD\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"DiskImageSize\": 3071064576.0, \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"SnapshotId\": \"snap-0d03e300d77484906\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"UserBucket\": {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"S3Bucket\": \"awscfme59\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"S3Key\": \"cfme-ec2-5.9.0.22-1.x86_64.vhd\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0], \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"Progress\": \"85\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"StatusMessage\": \"preparing ami\", \r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"ImportTaskId\": \"import-ami-ffut8pit\r\n\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0]\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">When the task import is finished you will see the field <\/span><span style=\"font-weight: 400\">&#8220;<strong>ImageId<\/strong>&#8220;: &#8220;ami-140fc869&#8221;, in the task output.<\/span><\/p>\n<pre class=\"lang:default decode:true\">[ec2-user@ip-172-31-14-85 ~]$ aws ec2 describe-import-image-tasks --import-task-ids import-ami-ffut8pit\r\n{\r\n    \"ImportImageTasks\": [\r\n        {\r\n            \"Status\": \"completed\", \r\n            \"LicenseType\": \"BYOL\", \r\n            \"Description\": \"CFME 5.9.0.22\", \r\n            \"ImageId\": \"ami-140fc869\", \r\n            \"Platform\": \"Linux\", \r\n            \"Architecture\": \"x86_64\", \r\n            \"SnapshotDetails\": [\r\n                {\r\n                    \"DeviceName\": \"\/dev\/sda1\", \r\n                    \"Description\": \"cfme5922\", \r\n                    \"Format\": \"VHD\", \r\n                    \"DiskImageSize\": 3071064576.0, \r\n                    \"SnapshotId\": \"snap-099c934a3bfe52a16\", \r\n                    \"UserBucket\": {\r\n                        \"S3Bucket\": \"awscfme59\", \r\n                        \"S3Key\": \"cfme-ec2-5.9.0.22-1.x86_64.vhd\"\r\n                    }\r\n                }\r\n            ], \r\n            \"ImportTaskId\": \"import-ami-ffut8pit\"\r\n        }\r\n    ]\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">The ami will have a cryptic name which is not very readable. So let&#8217;s change the name<\/span><\/p>\n<pre class=\"lang:default decode:true\">[ec2-user@ip-172-31-14-85 ~]$ aws ec2 copy-image --source-image-id ami-140fc869 --source-region us-east-1 --region us-east-1 --name \"cfme_5922\"\r\n{\r\n    \"ImageId\": \"ami-ec04c391\"\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">Let&#8217;s go an cleanup so we don\u2019t have to pay for aws resources we don\u2019t need. \u00a0<\/span><\/p>\n<pre class=\"lang:default decode:true\">[ec2-user@ip-172-31-16-233 ~]$ aws ec2 deregister-image --image-id ami-140fc869<\/pre>\n<p><span style=\"font-weight: 400\">You can also delete the file we uploaded to s3 to save costs<\/span><\/p>\n<pre class=\"lang:default decode:true\">[ec2-user@ip-172-31-16-233 ~]$ aws s3 rm s3:\/\/awscfme59\/cfme-ec2-5.9.0.22-1.x86_64.vhd\r\n\r\n\u00a0delete: s3:\/\/awscfme59\/cfme-ec2-5.9.0.22-1.x86_64.vhd<\/pre>\n<p>And remove the bucket as well<\/p>\n<pre class=\"lang:default decode:true \">[ec2-user@ip-172-31-16-233 ~]$ aws s3 rb s3:\/\/awscfme59 --force\r\n\r\nremove_bucket: awscfme59<\/pre>\n<p><span style=\"font-weight: 400\">Go back to your aws console and click on my AMI. You should now see your new CloudForms AMI ready to launch.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2295\" src=\"http:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-9.16.02-PM.jpg\" alt=\"\" width=\"1992\" height=\"193\" srcset=\"https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-9.16.02-PM.jpg 1992w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-9.16.02-PM-300x29.jpg 300w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-9.16.02-PM-768x74.jpg 768w, https:\/\/blog.domb.net\/wp-content\/uploads\/Screen-Shot-2018-03-11-at-9.16.02-PM-1024x99.jpg 1024w\" sizes=\"auto, (max-width: 1992px) 100vw, 1992px\" \/><\/p>\n<p>Once the ami\u00a0is done copying you will see the status to available.\u00a0You are now ready to launch the CFME instance. For instance type choose t2.xlarge. Please follow the installation guide for the initial setup once the appliance is imported. The next post will explain how to add the AWS provider correctly and what roles and aws service will need to be enabled for a Smart state analysis to work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever wondered what CloudForms can do for you in AWS? The next few blog posts will walk you through step by step how to upload the CloudForms image to AWS, how to assign the correct policies and roles and how to configure it correctly so it can discover your environment. Part 1 is dedicated to&#8230;<\/p>\n","protected":false},"author":2,"featured_media":2048,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[37],"tags":[],"class_list":["post-2283","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloudforms"],"_links":{"self":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/2283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2283"}],"version-history":[{"count":6,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/2283\/revisions"}],"predecessor-version":[{"id":2369,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/2283\/revisions\/2369"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/media\/2048"}],"wp:attachment":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}