AWS Service Policy
VM Import uses a role in your AWS account to
perform certain operations (for example, downloading disk images from an Amazon S3
bucket). You
must create a role with the name vmimport with the following policy and trusted entities.
- Install the AWS CLI by following the instructions at http://docs.aws.amazon.com/cli/latest/userguide/installing.html
- Enter the following command in the AWS CLI
#sudo pip install awscli. - Get the access key for the AWS CLI by following the instructions on the AWS website.
- Add the access key details to the AWS CLI using the following commands
- Create a file named role-policy.json with the following policy:
{ "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action":[ "s3:ListBucket", "s3:GetBucketLocation" ], "Resource":[ "arn:aws:s3:::<disk-image-file-bucket>" ] }, { "Effect":"Allow", "Action":[ "s3:GetObject" ], "Resource":[ "arn:aws:s3:::<disk-image-file-bucket>/*" ] }, { "Effect":"Allow", "Action":[ "ec2:ModifySnapshotAttribute", "ec2:CopySnapshot", "ec2:RegisterImage", "ec2:Describe*" ], "Resource":"*" } ] } - Replace <disk-image-file-bucket> with the appropriate Amazon S3 bucket where the disk files are stored. Run the following command to attach the policy to the role created above:
- Replace <disk-image-file-bucket> with the appropriate Amazon S3 bucket where
the disk files are stored. Run the following command to attach the policy to the role
created above
aws iam put-role-policy --role-name vmimport --policy-name vsz34-policy --policy-document file://role-policy.json