eschwim / centos7-ami-builder Goto Github PK
View Code? Open in Web Editor NEWA script to (nearly) fully automate the process of building Centos7 Amazon Machine Images (AMIs)
A script to (nearly) fully automate the process of building Centos7 Amazon Machine Images (AMIs)
Hello @eschwim
I have encountered the following erorr:
./centos7-ami-builder.sh hvm <ami_name>
FATAL: AMI size must be an integer!
I entered 20GB instead of 20. Is there a method to rest the config for the ami-builder script?
There is a small change needed to support AWS Govcloud (and possibly Montreal region?). According to http://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-ec2.html the bundles need a different cert to work successfully with ec2-bundle-image.
I got the script to work fine by adding --ec2cert $EC2_AMITOOL_HOME/etc/ec2/amitools/cert-ec2-gov.pem to the ec2-bundle-image command (note that $EC2_AMITOOL_HOME by default is not set, so the cert path is /etc/ec2/amitools/cert-ec2-gov.pem). Patch is below. It would be cool if the script detected govcloud and added the required ec2cert parameter. Given that my /etc/ec2/amitools/ directory also includes a cert for cn-north-1 this might be required for Montreal region as well, but I don't see documentation to that effect.
diff --git a/centos7-ami-builder.sh b/centos7-ami-builder.sh
index 57d025c..31238b4 100755
--- a/centos7-ami-builder.sh
+++ b/centos7-ami-builder.sh
@@ -420,7 +420,7 @@ undefine_hvm_dev() {
bundle_ami() {
output "Bundling AMI for upload..."
RUBYLIB=/usr/lib/ruby/site_ruby/ ec2-bundle-image --privatekey $AWS_PRIVATE_KEY --cert $AWS_CERT \
- --user $AWS_USER --image $AMI_IMG --prefix $AMI_NAME --destination $AMI_OUT --arch x86_64 || \
+ --user $AWS_USER --image $AMI_IMG --prefix $AMI_NAME --destination $AMI_OUT --arch x86_64 --ec2cert $EC2_AMITOOL_HOME/etc/ec2/amitools/cert-ec2-gov.pem || \
fatal "Failed to bundle image!"
AMI_MANIFEST=$AMI_OUT/$AMI_NAME.manifest.xml
}
This script worked quite well in Dec 2016.
I tried to run it again, and the instance failed to boot.
Has anyone tested/validated the functionality in March 2017?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.