From 146e839ecf92f0f2749c01b452c3c46c379f5fc0 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Tue, 17 Jun 2014 18:42:57 -0700 Subject: [PATCH 01/13] Cleaned up boot_as_* scripts; moved non-scheduler functions to main scripts; added RAID ephemeral and encrypted ephemeral support --- bootstrap/src/scripts/boot_as_compute | 76 +++++++++ bootstrap/src/scripts/boot_as_master | 149 ++++++++++++++++++ .../src/scripts/openlava/boot_as_compute | 42 ----- bootstrap/src/scripts/openlava/boot_as_master | 114 -------------- bootstrap/src/scripts/sge/boot_as_compute | 49 +----- bootstrap/src/scripts/sge/boot_as_master | 136 ---------------- bootstrap/src/scripts/torque/boot_as_compute | 56 ------- bootstrap/src/scripts/torque/boot_as_master | 126 --------------- 8 files changed, 227 insertions(+), 521 deletions(-) diff --git a/bootstrap/src/scripts/boot_as_compute b/bootstrap/src/scripts/boot_as_compute index d92b4db8d0..1ba573b5e1 100755 --- a/bootstrap/src/scripts/boot_as_compute +++ b/bootstrap/src/scripts/boot_as_compute @@ -31,6 +31,82 @@ if [ $RC -ne 0 ]; then error_exit "Failed to run boot_as_compute preinstall" fi +## Non-scheduler specific functions +## + +# LVM, format, mount /ephemeral +RC=0 +mkdir -p /scratch +chmod 1777 /scratch +DEVS=$(/usr/bin/ec2-metadata -b | grep ephemeral | awk '{print $2}') +NUM_DEVS=0 +for d in $DEVS; do + d=/dev/${d} + dd if=/dev/zero of=${d} bs=32k count=1 + parted -s ${d} mklabel msdos + parted -s ${d} + parted -s -a optimal ${d} mkpart primary 1MB 100% + parted -s ${d} set 1 lvm on + let NUM_DEVS++ + PARTITIONS="$PARTITIONS ${d}1" +done +# sleep 10 seconds to let partitions settle (bug?) +sleep 10 + +# Setup LVM +pvcreate $PARTITIONS +vgcreate vg.01 $PARTITIONS +if [ "$cfn_secure_ephemeral" == "true" ] then + mkfs -q /dev/ram1 1024 + mkdir -p /root/keystore + mount /dev/ram1 /root/keystore + dd if=/dev/urandom of=/root/keystore/keyfile bs=1024 count=4 + chmod 0400 /root/keystore/keyfile + cryptsetup -q luksFormat /dev/vg.01/lv_ephemeral /root/keystore/keyfile + cryptsetup -d /root/keystore/keyfile luksOpen /dev/vg.01/lv_ephemeral ephemeral_luks + mkfs.xfs /dev/mapper/ephemeral_luks + mount -v -t xfs -o noatime,nodiratime /dev/mapper/ephemeral_luks /scratch +else + lvcreate -i $NUM_DEVS -I 64 -l 100%FREE -n lv_ephemeral vg.01 + mkfs.xfs /dev/vg.01/lv_ephemeral + echo "/dev/vg.01/lv_ephemeral /scratch xfs noatime,nodiratime 0 0" >> /etc/fstab + mount -v /scratch +fi +chmod 1777 /scratch + +# Mount NFS exports +RC=0 +echo "$cfn_master:/home /home nfs hard,intr,noatime,vers=3,_netdev 0 0" >> /etc/fstab || RC=1 +echo "$cfn_master:/shared /shared nfs hard,intr,noatime,vers=3,_netdev 0 0" >> /etc/fstab || RC=1 +mount -v /home || RC=1 +mount -v /shared || RC=1 +if [ $RC -ne 0 ]; then + error_exit "Failed during during NFS mounts" +fi + +# Configure ganglia +RC=0 +location=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/placement/availability-zone` || RC=1 +cd /etc/ganglia || RC=1 +/bin/cp -f /opt/cfncluster/templates/os/gmond.conf.COMPUTE gmond.conf || RC=1 +sed -i "s//$cfn_master/" gmond.conf || RC=1 +sed -i "s//$location/" gmond.conf || RC=1 +chkconfig gmond on || RC=1 +service gmond start || RC=1 +if [ $RC -ne 0 ]; then + error_exit "Failed during Ganglia setup" +fi + +# Adding nodewatcher to crontab +RC=0 +crontab -l > /tmp/root.crontab +echo "* * * * * cd /opt/cfncluster/nodewatcher && ./nodewatcher.py >> nodewatcher.log 2>&1" >> /tmp/root.crontab || RC=1 +crontab /tmp/root.crontab || RC=1 +if [ $RC -ne 0 ]; then + error_exit "Failed to nodewatcher crontab" +fi + +## # Run boot as compute for a specific scheduler RC=0 /opt/cfncluster/scripts/${cfn_scheduler}/boot_as_compute >/var/log/cfncluster.log 2>&1 || RC=1 diff --git a/bootstrap/src/scripts/boot_as_master b/bootstrap/src/scripts/boot_as_master index 679714ace4..994e0219f0 100755 --- a/bootstrap/src/scripts/boot_as_master +++ b/bootstrap/src/scripts/boot_as_master @@ -31,6 +31,155 @@ if [ $RC -ne 0 ]; then error_exit "Failed to run boot_as_master preinstall" fi +## Non-scheduler specific functions +## + +# Check cfn_volume is present in config +if [ "${cfn_volume}x" == "x" ]; then + error_exit "Volume must be provided." +fi + +# Check hostname resolves using DNS +myhostname=$(hostname -s) +if [ $? != 0 ]; then + error_exit 'Failed to determine local hostname' +fi + +# Enable PAT +RC=0 +/opt/cfncluster/scripts/os/configure-pat.sh || RC=1 +echo -e "\n# Enable PAT\n/opt/cfncluster/scripts/os/configure-pat.sh\n\n" >> /etc/rc.local || RC=1 +if [ $RC -ne 0 ]; then + error_exit "Failed to enable NAT(PAT)" +fi + +# LVM, format, mount /ephemeral +RC=0 +mkdir -p /scratch +chmod 1777 /scratch +DEVS=$(/usr/bin/ec2-metadata -b | grep ephemeral | awk '{print $2}') +NUM_DEVS=0 +for d in $DEVS; do + d=/dev/${d} + dd if=/dev/zero of=${d} bs=32k count=1 + parted -s ${d} mklabel msdos + parted -s ${d} + parted -s -a optimal ${d} mkpart primary 1MB 100% + parted -s ${d} set 1 lvm on + let NUM_DEVS++ + PARTITIONS="$PARTITIONS ${d}1" +done +# sleep 10 seconds to let partitions settle (bug?) +sleep 10 + +# Setup LVM +pvcreate $PARTITIONS +vgcreate vg.01 $PARTITIONS +if [ "$cfn_secure_ephemeral" == "true" ] then + mkfs -q /dev/ram1 1024 + mkdir -p /root/keystore + mount /dev/ram1 /root/keystore + dd if=/dev/urandom of=/root/keystore/keyfile bs=1024 count=4 + chmod 0400 /root/keystore/keyfile + cryptsetup -q luksFormat /dev/vg.01/lv_ephemeral /root/keystore/keyfile + cryptsetup -d /root/keystore/keyfile luksOpen /dev/vg.01/lv_ephemeral ephemeral_luks + mkfs.xfs /dev/mapper/ephemeral_luks + mount -v -t xfs -o noatime,nodiratime /dev/mapper/ephemeral_luks /scratch +else + lvcreate -i $NUM_DEVS -I 64 -l 100%FREE -n lv_ephemeral vg.01 + mkfs.xfs /dev/vg.01/lv_ephemeral + echo "/dev/vg.01/lv_ephemeral /scratch xfs noatime,nodiratime 0 0" >> /etc/fstab + mount -v /scratch +fi +chmod 1777 /scratch + +# Attach and mount /shared volume +RC=0 +/usr/local/sbin/attachVolume.py ${cfn_volume} || RC=1 +sleep 10 # Hate having to do this... +dev=$(stat /dev/disk/by-ebs-volumeid/${cfn_volume}|grep -- 'File:'|awk '{print $4}'|cut -d'/' -f3|tr -d "'") +fs_type=$(blkid -o list | grep -- "$dev" | awk '{print $2}') +if [ "${fs_type}x" == "x" ]; then + mkfs.xfs /dev/disk/by-ebs-volumeid/${cfn_volume} || RC=1 + sleep 5 +fi +fs_type=$(blkid -o list | grep -- "$dev" | awk '{print $2}') +echo "/dev/disk/by-ebs-volumeid/${cfn_volume} /shared $fs_type noatime,nodiratime 0 0" >> /etc/fstab +mount -v /shared || RC=1 +chmod 1777 /shared || RC=1 +if [ $RC -ne 0 ]; then + error_exit "Failed to attach and mount volume" +fi + +# Setup NFS as Master +# 1. Determine subnet for NFS exports +ETH0_MAC=`/sbin/ifconfig | /bin/grep eth0 | awk '{print tolower($5)}' | grep '^[0-9a-f]\{2\}\(:[0-9a-f]\{2\}\)\{5\}$'` +VPC_CIDR_URI="http://169.254.169.254/latest/meta-data/network/interfaces/macs/${ETH0_MAC}/vpc-ipv4-cidr-block" +VPC_CIDR_RANGE=`curl --retry 3 --retry-delay 0 --silent --fail ${VPC_CIDR_URI}` +if [ $? -ne 0 ] ; then + echo "Unable to retrive VPC CIDR range from meta-data. This either means a) non-VPC or b) an error" | logger -t "cfncluster" + VPC_CIDR_RANGE="10.0.0.0/8" +else + echo "Retrived the VPC CIDR range: ${VPC_CIDR_RANGE} from meta-data for NFS export." | logger -t "cfncluster" +fi +# 2. Update config +RC=0 +cd /etc || RC=1 +/bin/cp -f /opt/cfncluster/templates/os/exports.MASTER exports || RC=1 +sed -i "s??$VPC_CIDR_RANGE?" exports || RC=1 +if [ $RC -ne 0 ]; then + error_exit "Failed to configure NFS exports" +fi +# 3. Start NFS +RC=0 +chkconfig nfs on || RC=1 +chkconfig rpcbind on || RC=1 +chkconfig rpcidmapd on || RC=1 +service rpcbind restart || RC=1 +service rpcidmapd restart || RC=1 +service nfs restart || RC=1 +if [ $RC -ne 0 ]; then + error_exit "Failed to start NFS server" +fi + +# Setup Ganglia as Master +RC=0 +location=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/placement/availability-zone` || RC=1 +cd /etc/ganglia || RC=1 +/bin/cp -f /opt/cfncluster/templates/os/gmond.conf.MASTER gmond.conf || RC=1 +/bin/cp -f /opt/cfncluster/templates/os/gmetad.conf.MASTER gmetad.conf || RC=1 +sed -i "s//$myhostname/" gmond.conf || RC=1 +sed -i "s//$location/" gmond.conf || RC=1 +sed -i "s//$stack_name/" gmond.conf || RC=1 +sed -i "s//$stack_name/" gmetad.conf || RC=1 +if [ $RC -ne 0 ]; then + error_exit "Failed to configure Ganglia" +fi + +# Start httpd and ganglia services +RC=0 +chkconfig gmond on || RC=1 +chkconfig gmetad on || RC=1 +chkconfig httpd on || RC=1 +service gmond start || RC=1 +service gmetad start || RC=1 +service httpd start || RC=1 +if [ $RC -ne 0 ]; then + error_exit "Failed to start Ganglia" +fi + +# Setup ec2-user SSH auth +RC=0 +su - ec2-user -c "ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ''" || RC=1 +su - ec2-user -c "cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys2 && chmod 0600 ~/.ssh/authorized_keys2" || RC=1 +su - ec2-user -c "ssh-keyscan ${myhostname} > ~/.ssh/known_hosts && chmod 0600 ~/.ssh/known_hosts" || RC=1 +if [ $RC -ne 0 ]; then + error_exit "Failed to setup ec2-user SSH auth" +fi + +## Scheduler specific section +## + # Run boot as master for a specific scheduler RC=0 /opt/cfncluster/scripts/${cfn_scheduler}/boot_as_master >/var/log/cfncluster.log 2>&1 || RC=1 diff --git a/bootstrap/src/scripts/openlava/boot_as_compute b/bootstrap/src/scripts/openlava/boot_as_compute index 003d3a07f6..f54e8ded49 100755 --- a/bootstrap/src/scripts/openlava/boot_as_compute +++ b/bootstrap/src/scripts/openlava/boot_as_compute @@ -39,34 +39,6 @@ instance_type=$(echo $instance_type| tr '.' '_') # Setup resources resources="cs $instance_type $cfn_resources" -# Mount NFS exports -function mount_nfs () { -RC=0 -echo "$cfn_master:/home /home nfs hard,intr,noatime,vers=3,_netdev 0 0" >> /etc/fstab || RC=1 -echo "$cfn_master:/shared /shared nfs hard,intr,noatime,vers=3,_netdev 0 0" >> /etc/fstab || RC=1 -mount -v /home || RC=1 -mount -v /shared || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed during during NFS mounts" -fi -} - -# Configure ganglia -function configure_ganglia () { -RC=0 -location=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/placement/availability-zone` || RC=1 -cd /etc/ganglia || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/gmond.conf.COMPUTE gmond.conf || RC=1 -sed -i "s//$cfn_master/" gmond.conf || RC=1 -sed -i "s//$location/" gmond.conf || RC=1 -sed -i "s//$stack_name/" gmond.conf || RC=1 -chkconfig gmond on || RC=1 -service gmond start || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed during Ganglia setup" -fi -} - # Configure openlava function configure_openlava () { RC=0 @@ -93,23 +65,9 @@ if [ $RC -ne 0 ]; then fi } -# Adding nodewatcher to crontab -function add_nodewatcher () { -RC=0 -crontab -l > /tmp/root.crontab -echo "* * * * * cd /opt/cfncluster/nodewatcher && ./nodewatcher.py >> nodewatcher.log 2>&1" >> /tmp/root.crontab || RC=1 -crontab /tmp/root.crontab || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to nodewatcher crontab" -fi -} - function minimal_install () { - mount_nfs - configure_ganglia configure_openlava start_openlava - add_nodewatcher } ## Main script diff --git a/bootstrap/src/scripts/openlava/boot_as_master b/bootstrap/src/scripts/openlava/boot_as_master index 9162f68247..4c9027822f 100755 --- a/bootstrap/src/scripts/openlava/boot_as_master +++ b/bootstrap/src/scripts/openlava/boot_as_master @@ -23,108 +23,11 @@ function error_exit () { exit 1 } -if [ "${cfn_volume}x" == "x" ]; then - error_exit "Volume must be provided." -fi - myhostname=$(hostname -s) if [ $? != 0 ]; then error_exit 'Failed to determine local hostname' fi -# Enable PAT -function enable_pat () { -RC=0 -/opt/cfncluster/scripts/os/configure-pat.sh || RC=1 -echo -e "\n# Enable PAT\n/opt/cfncluster/scripts/os/configure-pat.sh\n\n" >> /etc/rc.local || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to enable NAT(PAT)" -fi -} - -# Attach and mount volume -function attach_mount_volume () { -RC=0 -/usr/local/sbin/attachVolume.py ${cfn_volume} || RC=1 -sleep 10 # Hate having to do this... -dev=$(stat /dev/disk/by-ebs-volumeid/${cfn_volume}|grep -- 'File:'|awk '{print $4}'|cut -d'/' -f3|tr -d "'") -fs_type=$(blkid -o list | grep -- "$dev" | awk '{print $2}') -if [ "${fs_type}x" == "x" ]; then - mkfs.xfs /dev/disk/by-ebs-volumeid/${cfn_volume} || RC=1 - sleep 5 -fi -fs_type=$(blkid -o list | grep -- "$dev" | awk '{print $2}') -echo "/dev/disk/by-ebs-volumeid/${cfn_volume} /shared $fs_type noatime,nodiratime 0 0" >> /etc/fstab -mount -v /shared || RC=1 -chmod 1777 /shared || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to attach and mount volume" -fi -} - -# Setup NFS as Master -function setup_master_nfs () { -# 1. Determine subnet for NFS exports -ETH0_MAC=`/sbin/ifconfig | /bin/grep eth0 | awk '{print tolower($5)}' | grep '^[0-9a-f]\{2\}\(:[0-9a-f]\{2\}\)\{5\}$'` -VPC_CIDR_URI="http://169.254.169.254/latest/meta-data/network/interfaces/macs/${ETH0_MAC}/vpc-ipv4-cidr-block" -VPC_CIDR_RANGE=`curl --retry 3 --retry-delay 0 --silent --fail ${VPC_CIDR_URI}` -if [ $? -ne 0 ] ; then - echo "Unable to retrive VPC CIDR range from meta-data. This either means a) non-VPC or b) an error" | logger -t "cfncluster" - VPC_CIDR_RANGE="10.0.0.0/8" -else - echo "Retrived the VPC CIDR range: ${VPC_CIDR_RANGE} from meta-data for NFS export." | logger -t "cfncluster" -fi -# 2. Update config -RC=0 -cd /etc || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/exports.MASTER exports || RC=1 -sed -i "s??$VPC_CIDR_RANGE?" exports || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to configure NFS exports" -fi -# 3. Start NFS -RC=0 -chkconfig nfs on || RC=1 -chkconfig rpcbind on || RC=1 -chkconfig rpcidmapd on || RC=1 -service rpcbind restart || RC=1 -service rpcidmapd restart || RC=1 -service nfs restart || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to start NFS server" -fi -} - -# Setup Ganglia as Master -function setup_master_ganglia () { -RC=0 -location=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/placement/availability-zone` || RC=1 -cd /etc/ganglia || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/gmond.conf.MASTER gmond.conf || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/gmetad.conf.MASTER gmetad.conf || RC=1 -sed -i "s//$myhostname/" gmond.conf || RC=1 -sed -i "s//$location/" gmond.conf || RC=1 -sed -i "s//$stack_name/" gmond.conf || RC=1 -sed -i "s//$stack_name/" gmetad.conf || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to configure Ganglia" -fi -} - -# Start httpd and ganglia services -function start_http_ganglia () { -RC=0 -chkconfig gmond on || RC=1 -chkconfig gmetad on || RC=1 -chkconfig httpd on || RC=1 -service gmond start || RC=1 -service gmetad start || RC=1 -service httpd start || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to start Ganglia" -fi -} - # Setup openlava config as Master function setup_master_openlava () { RC=0 @@ -152,17 +55,6 @@ if [ $RC -ne 0 ]; then fi } -# Setup ec2-user SSH auth -function setup_ssh_auth () { -RC=0 -su - ec2-user -c "ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ''" || RC=1 -su - ec2-user -c "cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys2 && chmod 0600 ~/.ssh/authorized_keys2" || RC=1 -su - ec2-user -c "ssh-keyscan ${myhostname} > ~/.ssh/known_hosts && chmod 0600 ~/.ssh/known_hosts" || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to setup ec2-user SSH auth" -fi -} - # Start openlava function start_openlava () { RC=0 @@ -176,15 +68,9 @@ fi } function minimal_install () { - enable_pat - attach_mount_volume - setup_master_nfs - setup_master_ganglia - start_http_ganglia setup_master_openlava start_openlava add_custom_metric - setup_ssh_auth } ## Main script diff --git a/bootstrap/src/scripts/sge/boot_as_compute b/bootstrap/src/scripts/sge/boot_as_compute index dfcdea1665..463278f337 100755 --- a/bootstrap/src/scripts/sge/boot_as_compute +++ b/bootstrap/src/scripts/sge/boot_as_compute @@ -32,36 +32,13 @@ if [ $? != 0 ]; then error_exit 'Failed to determine short hostname.' fi -# Determine instance type -instance_type=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/instance-type` -instance_type=$(echo $instance_type| tr '.' '_') - -# Mount NFS exports +# Mount SGE NFS exports function mount_nfs () { RC=0 -echo "$cfn_master:/home /home nfs hard,intr,noatime,vers=3,_netdev 0 0" >> /etc/fstab || RC=1 -echo "$cfn_master:/shared /shared nfs hard,intr,noatime,vers=3,_netdev 0 0" >> /etc/fstab || RC=1 echo "$cfn_master:/opt/sge /opt/sge nfs hard,intr,noatime,vers=3,_netdev 0 0" >> /etc/fstab || RC=1 -mount -v /home || RC=1 -mount -v /shared || RC=1 mount -v /opt/sge || RC=1 if [ $RC -ne 0 ]; then - error_exit "Failed during during NFS mounts" -fi -} - -# Configure ganglia -function configure_ganglia () { -RC=0 -location=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/placement/availability-zone` || RC=1 -cd /etc/ganglia || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/gmond.conf.COMPUTE gmond.conf || RC=1 -sed -i "s//$cfn_master/" gmond.conf || RC=1 -sed -i "s//$location/" gmond.conf || RC=1 -chkconfig gmond on || RC=1 -service gmond start || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed during Ganglia setup" + error_exit "Failed during during SGE NFS mounts" fi } @@ -75,27 +52,9 @@ if [ $RC -ne 0 ]; then fi } -# Adding nodewatcher to crontab -function add_nodewatcher () { -RC=0 -crontab -l > /tmp/root.crontab -echo "* * * * * cd /opt/cfncluster/nodewatcher && ./nodewatcher.py >> nodewatcher.log 2>&1" >> /tmp/root.crontab || RC=1 -crontab /tmp/root.crontab || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to nodewatcher crontab" -fi -} - function minimal_install () { mount_nfs setup_sge_profile - add_nodewatcher -} - -function full_install () { - mount_nfs - configure_ganglia - add_nodewatcher } ## Main script @@ -104,10 +63,6 @@ case $cfn_install_type in minimal_install ;; - full) - full_install - ;; - *) error_exit "Unkown install type: $cfn_install_type" diff --git a/bootstrap/src/scripts/sge/boot_as_master b/bootstrap/src/scripts/sge/boot_as_master index a5470e9347..4199e81c46 100755 --- a/bootstrap/src/scripts/sge/boot_as_master +++ b/bootstrap/src/scripts/sge/boot_as_master @@ -23,88 +23,11 @@ function error_exit () { exit 1 } -if [ "${cfn_volume}x" == "x" ]; then - error_exit "Volume must be provided." -fi - myhostname=$(hostname -s) if [ $? != 0 ]; then error_exit 'Failed to determine local hostname' fi -# Enable PAT -function enable_pat () { -RC=0 -/opt/cfncluster/scripts/os/configure-pat.sh || RC=1 -echo -e "\n# Enable PAT\n/opt/cfncluster/scripts/os/configure-pat.sh\n\n" >> /etc/rc.local || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to enable NAT(PAT)" -fi -} - -# Set MOTD -function set_motd () { -RC=0 -cd /etc || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/motd.MASTER motd || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to update /etc/motd" -fi -} - -# Attache and mount volume -function attach_mount_volume () { -RC=0 -/usr/local/sbin/attachVolume.py ${cfn_volume} || RC=1 -sleep 10 # Hate having to do this... -dev=$(stat /dev/disk/by-ebs-volumeid/${cfn_volume}|grep -- 'File:'|awk '{print $4}'|cut -d'/' -f3|tr -d "'") -fs_type=$(blkid -o list | grep -- "$dev" | awk '{print $2}') -if [ "${fs_type}x" == "x" ]; then - mkfs.xfs /dev/disk/by-ebs-volumeid/${cfn_volume} || RC=1 - sleep 5 -fi -fs_type=$(blkid -o list | grep -- "$dev" | awk '{print $2}') -echo "/dev/disk/by-ebs-volumeid/${cfn_volume} /shared $fs_type noatime,nodiratime 0 0" >> /etc/fstab -mount -v /shared || RC=1 -chmod 1777 /shared || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to attach and mount volume" -fi -} - -# Setup NFS as Master -function setup_master_nfs () { -# 1. Determine subnet for NFS exports -ETH0_MAC=`/sbin/ifconfig | /bin/grep eth0 | awk '{print tolower($5)}' | grep '^[0-9a-f]\{2\}\(:[0-9a-f]\{2\}\)\{5\}$'` -VPC_CIDR_URI="http://169.254.169.254/latest/meta-data/network/interfaces/macs/${ETH0_MAC}/vpc-ipv4-cidr-block" -VPC_CIDR_RANGE=`curl --retry 3 --retry-delay 0 --silent --fail ${VPC_CIDR_URI}` -if [ $? -ne 0 ] ; then - echo "Unable to retrive VPC CIDR range from meta-data. This either means a) non-VPC or b) an error" | logger -t "cfncluster" - VPC_CIDR_RANGE="10.0.0.0/8" -else - echo "Retrived the VPC CIDR range: ${VPC_CIDR_RANGE} from meta-data for NFS export." | logger -t "cfncluster" -fi -# 2. Update config -RC=0 -cd /etc || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/exports.MASTER exports || RC=1 -sed -i "s??$VPC_CIDR_RANGE?" exports || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to configure NFS exports" -fi -# 3. Start NFS -RC=0 -chkconfig nfs on || RC=1 -chkconfig rpcbind on || RC=1 -chkconfig rpcidmapd on || RC=1 -service rpcbind restart || RC=1 -service rpcidmapd restart || RC=1 -service nfs restart || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to start NFS server" -fi -} - # Setup SGE config as Master function setup_master_sge () { RC=0 @@ -117,48 +40,6 @@ if [ $RC -ne 0 ]; then fi } -# Setup Ganglia as Master -function setup_master_ganglia () { -RC=0 -location=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/placement/availability-zone` || RC=1 -cd /etc/ganglia || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/gmond.conf.MASTER gmond.conf || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/gmetad.conf.MASTER gmetad.conf || RC=1 -sed -i "s//$myhostname/" gmond.conf || RC=1 -sed -i "s//$location/" gmond.conf || RC=1 -sed -i "s//$stack_name/" gmond.conf || RC=1 -sed -i "s//$stack_name/" gmetad.conf || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to configure Ganglia" -fi -} - -# Start httpd and ganglia services -function start_http_ganglia () { -RC=0 -chkconfig gmond on || RC=1 -chkconfig gmetad on || RC=1 -chkconfig httpd on || RC=1 -service gmond start || RC=1 -service gmetad start || RC=1 -service httpd start || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to start Ganglia" -fi -} - -# Start VNC server for ec2user -function start_vncserver () { -RC=0 -cd /etc/sysconfig || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/tvncservers.MASTER tvncservers || RC=1 -chkconfig tvncserver on || RC=1 -service tvncserver start || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to setup TurboVNC" -fi -} - # Start SGE function start_sge () { RC=0 @@ -190,28 +71,11 @@ if [ $RC -ne 0 ]; then fi } -# Setup ec2-user SSH auth -function setup_ssh_auth () { -RC=0 -su - ec2-user -c "ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ''" || RC=1 -su - ec2-user -c "cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys2 && chmod 0600 ~/.ssh/authorized_keys2" || RC=1 -su - ec2-user -c "ssh-keyscan ${myhostname} > ~/.ssh/known_hosts && chmod 0600 ~/.ssh/known_hosts" || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to setup ec2-user SSH auth" -fi -} - function minimal_install () { - enable_pat - attach_mount_volume - setup_master_nfs setup_master_sge - setup_master_ganglia - start_http_ganglia start_sge add_master_submit add_custom_metric - setup_ssh_auth } ## Main script diff --git a/bootstrap/src/scripts/torque/boot_as_compute b/bootstrap/src/scripts/torque/boot_as_compute index 7f4330102d..28a0e0d77e 100755 --- a/bootstrap/src/scripts/torque/boot_as_compute +++ b/bootstrap/src/scripts/torque/boot_as_compute @@ -32,23 +32,6 @@ if [ $? != 0 ]; then error_exit 'Failed to determine short hostname.' fi -# Determine instance type -instance_type=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/instance-type` -instance_type=$(echo $instance_type| tr '.' '_') - -# Mount NFS exports -function mount_nfs () { -RC=0 -echo "$cfn_master:/home /home nfs hard,intr,noatime,vers=3,_netdev 0 0" >> /etc/fstab || RC=1 -echo "$cfn_master:/shared /shared nfs hard,intr,noatime,vers=3,_netdev 0 0" >> /etc/fstab || RC=1 -echo "$cfn_master:/opt/sge /opt/sge nfs hard,intr,noatime,vers=3,_netdev 0 0" >> /etc/fstab || RC=1 -mount -v /home || RC=1 -mount -v /shared || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed during during NFS mounts" -fi -} - function setup_torque () { RC=0 . /opt/cfncluster/templates/torque/torque.sh || RC=1 @@ -70,43 +53,8 @@ if [ $RC -ne 0 ]; then fi } -# Configure ganglia -function configure_ganglia () { -RC=0 -location=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/placement/availability-zone` || RC=1 -cd /etc/ganglia || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/gmond.conf.COMPUTE gmond.conf || RC=1 -sed -i "s//$cfn_master/" gmond.conf || RC=1 -sed -i "s//$location/" gmond.conf || RC=1 -chkconfig gmond on || RC=1 -service gmond start || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed during Ganglia setup" -fi -} - -# Adding nodewatcher to crontab -function add_nodewatcher () { -RC=0 -crontab -l > /tmp/root.crontab -echo "* * * * * cd /opt/cfncluster/nodewatcher && ./nodewatcher.py >> nodewatcher.log 2>&1" >> /tmp/root.crontab || RC=1 -crontab /tmp/root.crontab || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to nodewatcher crontab" -fi -} - function minimal_install () { - mount_nfs setup_torque - add_nodewatcher -} - -function full_install () { - mount_nfs - configure_ganglia - setup_torque - add_nodewatcher } ## Main script @@ -115,10 +63,6 @@ case $cfn_install_type in minimal_install ;; - full) - full_install - ;; - *) error_exit "Unkown install type: $cfn_install_type" diff --git a/bootstrap/src/scripts/torque/boot_as_master b/bootstrap/src/scripts/torque/boot_as_master index 0c9435a05b..62f33a9934 100755 --- a/bootstrap/src/scripts/torque/boot_as_master +++ b/bootstrap/src/scripts/torque/boot_as_master @@ -23,78 +23,11 @@ function error_exit () { exit 1 } -if [ "${cfn_volume}x" == "x" ]; then - error_exit "Volume must be provided." -fi - myhostname=$(hostname -s) if [ $? != 0 ]; then error_exit 'Failed to determine local hostname' fi -# Enable PAT -function enable_pat () { -RC=0 -/opt/cfncluster/scripts/os/configure-pat.sh || RC=1 -echo -e "\n# Enable PAT\n/opt/cfncluster/scripts/os/configure-pat.sh\n\n" >> /etc/rc.local || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to enable NAT(PAT)" -fi -} - -# Attache and mount volume -function attach_mount_volume () { -RC=0 -/usr/local/sbin/attachVolume.py ${cfn_volume} || RC=1 -sleep 10 # Hate having to do this... -dev=$(stat /dev/disk/by-ebs-volumeid/${cfn_volume}|grep -- 'File:'|awk '{print $4}'|cut -d'/' -f3|tr -d "'") -fs_type=$(blkid -o list | grep -- "$dev" | awk '{print $2}') -if [ "${fs_type}x" == "x" ]; then - mkfs.xfs /dev/disk/by-ebs-volumeid/${cfn_volume} || RC=1 - sleep 5 -fi -fs_type=$(blkid -o list | grep -- "$dev" | awk '{print $2}') -echo "/dev/disk/by-ebs-volumeid/${cfn_volume} /shared $fs_type noatime,nodiratime 0 0" >> /etc/fstab -mount -v /shared || RC=1 -chmod 1777 /shared || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to attach and mount volume" -fi -} - -# Setup NFS as Master -function setup_master_nfs () { -# 1. Determine subnet for NFS exports -ETH0_MAC=`/sbin/ifconfig | /bin/grep eth0 | awk '{print tolower($5)}' | grep '^[0-9a-f]\{2\}\(:[0-9a-f]\{2\}\)\{5\}$'` -VPC_CIDR_URI="http://169.254.169.254/latest/meta-data/network/interfaces/macs/${ETH0_MAC}/vpc-ipv4-cidr-block" -VPC_CIDR_RANGE=`curl --retry 3 --retry-delay 0 --silent --fail ${VPC_CIDR_URI}` -if [ $? -ne 0 ] ; then - echo "Unable to retrive VPC CIDR range from meta-data. This either means a) non-VPC or b) an error" | logger -t "cfncluster" - VPC_CIDR_RANGE="10.0.0.0/8" -else - echo "Retrived the VPC CIDR range: ${VPC_CIDR_RANGE} from meta-data for NFS export." | logger -t "cfncluster" -fi -# 2. Update config -RC=0 -cd /etc || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/exports.MASTER exports || RC=1 -sed -i "s??$VPC_CIDR_RANGE?" exports || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to configure NFS exports" -fi -# 3. Start NFS -RC=0 -chkconfig nfs on || RC=1 -chkconfig rpcbind on || RC=1 -chkconfig rpcidmapd on || RC=1 -service rpcbind restart || RC=1 -service rpcidmapd restart || RC=1 -service nfs restart || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to start NFS server" -fi -} - # Setup Torque on master function setup_master_torque () { RC=0 @@ -118,48 +51,6 @@ if [ $RC -ne 0 ]; then fi } -# Setup Ganglia as Master -function setup_master_ganglia () { -RC=0 -location=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/placement/availability-zone` || RC=1 -cd /etc/ganglia || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/gmond.conf.MASTER gmond.conf || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/gmetad.conf.MASTER gmetad.conf || RC=1 -sed -i "s//$myhostname/" gmond.conf || RC=1 -sed -i "s//$location/" gmond.conf || RC=1 -sed -i "s//$stack_name/" gmond.conf || RC=1 -sed -i "s//$stack_name/" gmetad.conf || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to configure Ganglia" -fi -} - -# Start httpd and ganglia services -function start_http_ganglia () { -RC=0 -chkconfig gmond on || RC=1 -chkconfig gmetad on || RC=1 -chkconfig httpd on || RC=1 -service gmond start || RC=1 -service gmetad start || RC=1 -service httpd start || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to start Ganglia" -fi -} - -# Start VNC server for ec2user -function start_vncserver () { -RC=0 -cd /etc/sysconfig || RC=1 -/bin/cp -f /opt/cfncluster/templates/os/tvncservers.MASTER tvncservers || RC=1 -chkconfig tvncserver on || RC=1 -service tvncserver start || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to setup TurboVNC" -fi -} - # Adding custom CloudWatch metric to crontab function add_custom_metric () { RC=0 @@ -171,26 +62,9 @@ if [ $RC -ne 0 ]; then fi } -# Setup ec2-user SSH auth -function setup_ssh_auth () { -RC=0 -su - ec2-user -c "ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ''" || RC=1 -su - ec2-user -c "cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys2 && chmod 0600 ~/.ssh/authorized_keys2" || RC=1 -su - ec2-user -c "ssh-keyscan $(hostname -f),$(hostname -s) > ~/.ssh/known_hosts && chmod 0600 ~/.ssh/known_hosts" || RC=1 -if [ $RC -ne 0 ]; then - error_exit "Failed to setup ec2-user SSH auth" -fi -} - function minimal_install () { - enable_pat - attach_mount_volume - setup_master_nfs setup_master_torque - setup_master_ganglia - start_http_ganglia add_custom_metric - setup_ssh_auth } ## Main script From 0b617511a51945c4f0a5caebb07e440e1ab74353 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Tue, 17 Jun 2014 18:46:28 -0700 Subject: [PATCH 02/13] Adding options for cluster placement groups and ephemeral encryption. --- cli/cfncluster/examples/config | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cli/cfncluster/examples/config b/cli/cfncluster/examples/config index 77c5b53653..be17f08043 100644 --- a/cli/cfncluster/examples/config +++ b/cli/cfncluster/examples/config @@ -65,6 +65,15 @@ key_name = mykey # HTTP(S) proxy server, typically http://x.x.x.x:8080 # (defaults to NONE for the default template) #proxy_server = NONE +# Cluster placement group. This placement group must already exist. +# (defaults to NONE for the default template) +#placement_group = NONE +# Cluster placment logic. This enables the whole cluster or only compute to use the placement group +# (defaults to cluster in the default template) +#placement = cluster +# Encrypted ephemeral drives. In-memory keys, non-recoverable. +# (defaults to false in default template) +#encrypted_ephemeral = false # Settings section relating to VPC to be used vpc_settings = public # Settings section relating to EBS volume From 2b5054caf211e2905e5f8e79a321b5976e2ad2db Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Tue, 17 Jun 2014 18:52:31 -0700 Subject: [PATCH 03/13] Adding options for cluster placement groups and ephemeral encryption. --- cloudformation/cfncluster.cfn.json | 78 +++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/cloudformation/cfncluster.cfn.json b/cloudformation/cfncluster.cfn.json index 9458cdb708..19d1f05da1 100644 --- a/cloudformation/cfncluster.cfn.json +++ b/cloudformation/cfncluster.cfn.json @@ -275,6 +275,30 @@ "Description" : "Addtional policy document to be added to EC2 IAM role created and assigned to all nodes.", "Type" : "String", "Default" : "NONE" + }, + "Placement" : { + "Description" : "Type of placement requird in cfncluster, it can either be cluster or compute.", + "Type" : "String", + "Default" : "cluster", + "AllowedValues" : [ + "cluster", + "compute" + ] + }, + "PlacementGroup" : { + "Description" : "The name of an exisiting placement group", + "Type" : "String", + "Default" : "NONE" + }, + "EncryptedEphemeral" : { + "Description" : "Boolean flag to encrypt local ephemeral drives. The keys are in-memory and non-recoverable.", + "Type" : "String", + "Default" : "true", + "ConstraintDescription" : "true/false", + "AllowedValues" : [ + "true", + "false" + ] } }, "Conditions" : { @@ -380,6 +404,26 @@ ] } ] + }, + "UsePlacementGroup" : { + "Fn::Not" : [ + { + "Fn::Equals" : [ + { + "Ref" : "PlacementGroup" + }, + "NONE" + ] + } + ] + }, + "UseComputePlacement" : { + "Fn::Equals" : [ + { + "Ref" : "Placement" + }, + "compute" + ] } }, "Mappings" : { @@ -864,6 +908,17 @@ }, "IamInstanceProfile" : { "Ref" : "RootInstanceProfile" + }, + "PlacementGroup" : { + "Fn::If" : [ + "UseComputePlacement", + { + "Ref" : "PlacementGroup" + }, + { + "Ref" : "AWS::NoValue" + } + ] } }, "Metadata" : { @@ -912,6 +967,11 @@ "Ref" : "Scheduler" }, "\n", + "cfn_encrypted_ephemeral=", + { + "Ref" : "EncryptedEphemeral" + }, + "\n", "cfn_node_type=MasterServer\n", "cfn_install_type=", { @@ -1049,7 +1109,18 @@ "Value" : "Compute", "PropagateAtLaunch" : "true" } - ] + ], + "PlacementGroup" : { + "Fn::If" : [ + "UsePlacementGroup", + { + "Ref" : "PlacementGroup" + }, + { + "Ref" : "AWS::NoValue" + } + ] + } }, "DependsOn" : "MasterServerWaitCondition" }, @@ -1217,6 +1288,11 @@ }, "\n", "cfn_node_type=ComputeFleet\n", + "cfn_encrypted_ephemeral=", + { + "Ref" : "EncryptedEphemeral" + }, + "\n", "cfn_install_type=", { "Ref" : "InstallType" From c1323f7a36d088ca9819888c79838442581223c4 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Tue, 17 Jun 2014 18:53:17 -0700 Subject: [PATCH 04/13] Making variable naming consistent --- bootstrap/src/scripts/boot_as_compute | 2 +- bootstrap/src/scripts/boot_as_master | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap/src/scripts/boot_as_compute b/bootstrap/src/scripts/boot_as_compute index 1ba573b5e1..dc698cab70 100755 --- a/bootstrap/src/scripts/boot_as_compute +++ b/bootstrap/src/scripts/boot_as_compute @@ -56,7 +56,7 @@ sleep 10 # Setup LVM pvcreate $PARTITIONS vgcreate vg.01 $PARTITIONS -if [ "$cfn_secure_ephemeral" == "true" ] then +if [ "$cfn_encrypted_ephemeral" == "true" ] then mkfs -q /dev/ram1 1024 mkdir -p /root/keystore mount /dev/ram1 /root/keystore diff --git a/bootstrap/src/scripts/boot_as_master b/bootstrap/src/scripts/boot_as_master index 994e0219f0..42236a8412 100755 --- a/bootstrap/src/scripts/boot_as_master +++ b/bootstrap/src/scripts/boot_as_master @@ -75,7 +75,7 @@ sleep 10 # Setup LVM pvcreate $PARTITIONS vgcreate vg.01 $PARTITIONS -if [ "$cfn_secure_ephemeral" == "true" ] then +if [ "$cfn_encrypted_ephemeral" == "true" ] then mkfs -q /dev/ram1 1024 mkdir -p /root/keystore mount /dev/ram1 /root/keystore From 5bc421306dd6e8c620146154e8687b9221d6d345 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Tue, 17 Jun 2014 18:56:11 -0700 Subject: [PATCH 05/13] Fixing bug with DESTDIR vs PREFIX --- bootstrap/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/Makefile b/bootstrap/Makefile index 2956fa1a9d..af46e95a12 100644 --- a/bootstrap/Makefile +++ b/bootstrap/Makefile @@ -1,5 +1,5 @@ SHELL = /bin/sh -PREFIX ?= /opt/cfncluster +DESTDIR ?= /opt/cfncluster install: install -d -m 755 $(DESTDIR) From 906ca4d2002e11f272ef20dd0b17143c8baa10cd Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Tue, 17 Jun 2014 19:01:39 -0700 Subject: [PATCH 06/13] Adding encrypted_ephemeral config key --- cli/cfncluster/cfnconfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/cfncluster/cfnconfig.py b/cli/cfncluster/cfnconfig.py index ed56d1b8fb..127b600939 100644 --- a/cli/cfncluster/cfnconfig.py +++ b/cli/cfncluster/cfnconfig.py @@ -135,7 +135,8 @@ def __init__(self, args): install_type='InstallType', scheduler='Scheduler', cluster_type='ClusterType', spot_price='SpotPrice', custom_ami='CustomAMI', pre_install='PreInstallScript', post_install='PostInstallScript', proxy_server='ProxyServer', - iam_policy='IAMPolicy', placement='Placement', placement_group='PlacementGroup') + iam_policy='IAMPolicy', placement='Placement', placement_group='PlacementGroup', + encrypted_ephemeral='EncryptedEphemeral') # Loop over all the cluster options and add define to parameters, raise Exception if defined but null for key in self.__cluster_options: From 7502f792b7e2931a8b8ba3c07d93a01b31e1edd9 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 18 Jun 2014 15:39:09 +0000 Subject: [PATCH 07/13] Fix: Check if ephemeral drives mapped, exist. --- bootstrap/src/scripts/boot_as_compute | 10 ++++++++-- bootstrap/src/scripts/boot_as_master | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bootstrap/src/scripts/boot_as_compute b/bootstrap/src/scripts/boot_as_compute index dc698cab70..dcfa8a7516 100755 --- a/bootstrap/src/scripts/boot_as_compute +++ b/bootstrap/src/scripts/boot_as_compute @@ -38,7 +38,13 @@ fi RC=0 mkdir -p /scratch chmod 1777 /scratch -DEVS=$(/usr/bin/ec2-metadata -b | grep ephemeral | awk '{print $2}') +MAPPING=$(/usr/bin/ec2-metadata -b | grep ephemeral | awk '{print $2}' | sed 's/sd/xvd/') +for m in MAPPING; do + check=$(stat -t /dev/${m} >/dev/null 2>&1) + if [ ${check} -eq 0 ]; then + DEVS="${m} $DEVS" + fi +done NUM_DEVS=0 for d in $DEVS; do d=/dev/${d} @@ -48,7 +54,7 @@ for d in $DEVS; do parted -s -a optimal ${d} mkpart primary 1MB 100% parted -s ${d} set 1 lvm on let NUM_DEVS++ - PARTITIONS="$PARTITIONS ${d}1" + PARTITIONS="${d}1 $PARTITIONS" done # sleep 10 seconds to let partitions settle (bug?) sleep 10 diff --git a/bootstrap/src/scripts/boot_as_master b/bootstrap/src/scripts/boot_as_master index 42236a8412..bb3df0c398 100755 --- a/bootstrap/src/scripts/boot_as_master +++ b/bootstrap/src/scripts/boot_as_master @@ -57,7 +57,13 @@ fi RC=0 mkdir -p /scratch chmod 1777 /scratch -DEVS=$(/usr/bin/ec2-metadata -b | grep ephemeral | awk '{print $2}') +MAPPING=$(/usr/bin/ec2-metadata -b | grep ephemeral | awk '{print $2}' | sed 's/sd/xvd/') +for m in MAPPING; do + check=$(stat -t /dev/${m} >/dev/null 2>&1) + if [ ${check} -eq 0 ]; then + DEVS="${m} $DEVS" + fi +done NUM_DEVS=0 for d in $DEVS; do d=/dev/${d} @@ -67,7 +73,7 @@ for d in $DEVS; do parted -s -a optimal ${d} mkpart primary 1MB 100% parted -s ${d} set 1 lvm on let NUM_DEVS++ - PARTITIONS="$PARTITIONS ${d}1" + PARTITIONS="${d}1 $PARTITIONS" done # sleep 10 seconds to let partitions settle (bug?) sleep 10 From 69d6f467c41a03c0134c7d454f7e3f8aabedb224 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 18 Jun 2014 15:56:02 +0000 Subject: [PATCH 08/13] Fixes for ephemeral drive setup. --- bootstrap/src/scripts/boot_as_compute | 7 ++++--- bootstrap/src/scripts/boot_as_master | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bootstrap/src/scripts/boot_as_compute b/bootstrap/src/scripts/boot_as_compute index dcfa8a7516..17d0b8ab03 100755 --- a/bootstrap/src/scripts/boot_as_compute +++ b/bootstrap/src/scripts/boot_as_compute @@ -39,8 +39,9 @@ RC=0 mkdir -p /scratch chmod 1777 /scratch MAPPING=$(/usr/bin/ec2-metadata -b | grep ephemeral | awk '{print $2}' | sed 's/sd/xvd/') -for m in MAPPING; do - check=$(stat -t /dev/${m} >/dev/null 2>&1) +for m in $MAPPING; do + stat -t /dev/${m} >/dev/null 2>&1 + check=$? if [ ${check} -eq 0 ]; then DEVS="${m} $DEVS" fi @@ -62,7 +63,7 @@ sleep 10 # Setup LVM pvcreate $PARTITIONS vgcreate vg.01 $PARTITIONS -if [ "$cfn_encrypted_ephemeral" == "true" ] then +if [ "$cfn_encrypted_ephemeral" == "true" ]; then mkfs -q /dev/ram1 1024 mkdir -p /root/keystore mount /dev/ram1 /root/keystore diff --git a/bootstrap/src/scripts/boot_as_master b/bootstrap/src/scripts/boot_as_master index bb3df0c398..15509e050f 100755 --- a/bootstrap/src/scripts/boot_as_master +++ b/bootstrap/src/scripts/boot_as_master @@ -58,8 +58,9 @@ RC=0 mkdir -p /scratch chmod 1777 /scratch MAPPING=$(/usr/bin/ec2-metadata -b | grep ephemeral | awk '{print $2}' | sed 's/sd/xvd/') -for m in MAPPING; do - check=$(stat -t /dev/${m} >/dev/null 2>&1) +for m in $MAPPING; do + stat -t /dev/${m} >/dev/null 2>&1 + check=$? if [ ${check} -eq 0 ]; then DEVS="${m} $DEVS" fi @@ -81,7 +82,7 @@ sleep 10 # Setup LVM pvcreate $PARTITIONS vgcreate vg.01 $PARTITIONS -if [ "$cfn_encrypted_ephemeral" == "true" ] then +if [ "$cfn_encrypted_ephemeral" == "true" ]; then mkfs -q /dev/ram1 1024 mkdir -p /root/keystore mount /dev/ram1 /root/keystore From cbd799328288c3111a88a7350e67ce8b7a2eca0d Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 18 Jun 2014 10:46:28 -0700 Subject: [PATCH 09/13] Adding support for pre/post install script args --- bootstrap/src/scripts/boot_as_compute | 16 ++++++++++++++-- bootstrap/src/scripts/boot_as_master | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/bootstrap/src/scripts/boot_as_compute b/bootstrap/src/scripts/boot_as_compute index 17d0b8ab03..b48398f345 100755 --- a/bootstrap/src/scripts/boot_as_compute +++ b/bootstrap/src/scripts/boot_as_compute @@ -25,7 +25,13 @@ function error_exit () { # Run preinstall script if defined RC=0 if [ "${cfn_preinstall}" != "NONE" ]; then - wget -qO- ${cfn_preinstall} | /bin/sh || RC=1 + tmpfile=$(mktemp) + wget -qO- ${cfn_preinstall} > $tmpfile || RC=1 + if [ "${cfn_preinstall_args}" != "NONE"]; then + args=${cfn_preinstall_args} + fi + /bin/sh $tmpfile $args || RC=1 + /bin/rm $tmpfile fi if [ $RC -ne 0 ]; then error_exit "Failed to run boot_as_compute preinstall" @@ -124,7 +130,13 @@ fi # Run postinstall script if defined RC=0 if [ "${cfn_postinstall}" != "NONE" ]; then - wget -qO- ${cfn_postinstall} | /bin/sh || RC=1 + tmpfile=$(mktemp) + wget -qO- ${cfn_postinstall} > $tmpfile || RC=1 + if [ "${cfn_postinstall_args}" != "NONE"]; then + args=${cfn_postinstall_args} + fi + /bin/sh $tmpfile $args || RC=1 + /bin/rm $tmpfile fi if [ $RC -ne 0 ]; then error_exit "Failed to run boot_as_compute postinstall" diff --git a/bootstrap/src/scripts/boot_as_master b/bootstrap/src/scripts/boot_as_master index 15509e050f..ee7f35642d 100755 --- a/bootstrap/src/scripts/boot_as_master +++ b/bootstrap/src/scripts/boot_as_master @@ -25,7 +25,13 @@ function error_exit () { # Run preinstall script if defined RC=0 if [ "${cfn_preinstall}" != "NONE" ]; then - wget -qO- ${cfn_preinstall} | /bin/sh || RC=1 + tmpfile=$(mktemp) + wget -qO- ${cfn_preinstall} > $tmpfile || RC=1 + if [ "${cfn_preinstall_args}" != "NONE"]; then + args=${cfn_preinstall_args} + fi + /bin/sh $tmpfile $args || RC=1 + /bin/rm $tmpfile fi if [ $RC -ne 0 ]; then error_exit "Failed to run boot_as_master preinstall" @@ -200,7 +206,13 @@ cd /opt/cfncluster/sqswatcher && ./sqswatcher.py 2>&1 # Run postinstall script if defined RC=0 if [ "${cfn_postinstall}" != "NONE" ]; then - wget -qO- ${cfn_postinstall} | /bin/sh || RC=1 + tmpfile=$(mktemp) + wget -qO- ${cfn_postinstall} > $tmpfile || RC=1 + if [ "${cfn_postinstall_args}" != "NONE"]; then + args=${cfn_postinstall_args} + fi + /bin/sh $tmpfile $args || RC=1 + /bin/rm $tmpfile fi if [ $RC -ne 0 ]; then error_exit "Failed to run boot_as_master postinstall" From aceb1a66f72c3746d6e917442123e6f6eda24fd8 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 18 Jun 2014 11:56:12 -0700 Subject: [PATCH 10/13] Fixing LVM volume create --- bootstrap/src/scripts/boot_as_compute | 4 ++-- bootstrap/src/scripts/boot_as_master | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap/src/scripts/boot_as_compute b/bootstrap/src/scripts/boot_as_compute index b48398f345..73d1cec0af 100755 --- a/bootstrap/src/scripts/boot_as_compute +++ b/bootstrap/src/scripts/boot_as_compute @@ -69,6 +69,7 @@ sleep 10 # Setup LVM pvcreate $PARTITIONS vgcreate vg.01 $PARTITIONS +lvcreate -i $NUM_DEVS -I 64 -l 100%FREE -n lv_ephemeral vg.01 if [ "$cfn_encrypted_ephemeral" == "true" ]; then mkfs -q /dev/ram1 1024 mkdir -p /root/keystore @@ -80,7 +81,6 @@ if [ "$cfn_encrypted_ephemeral" == "true" ]; then mkfs.xfs /dev/mapper/ephemeral_luks mount -v -t xfs -o noatime,nodiratime /dev/mapper/ephemeral_luks /scratch else - lvcreate -i $NUM_DEVS -I 64 -l 100%FREE -n lv_ephemeral vg.01 mkfs.xfs /dev/vg.01/lv_ephemeral echo "/dev/vg.01/lv_ephemeral /scratch xfs noatime,nodiratime 0 0" >> /etc/fstab mount -v /scratch @@ -102,7 +102,7 @@ RC=0 location=`curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/placement/availability-zone` || RC=1 cd /etc/ganglia || RC=1 /bin/cp -f /opt/cfncluster/templates/os/gmond.conf.COMPUTE gmond.conf || RC=1 -sed -i "s//$cfn_master/" gmond.conf || RC=1 +sed -i "s//${cfn_master}/" gmond.conf || RC=1 sed -i "s//$location/" gmond.conf || RC=1 chkconfig gmond on || RC=1 service gmond start || RC=1 diff --git a/bootstrap/src/scripts/boot_as_master b/bootstrap/src/scripts/boot_as_master index ee7f35642d..6f8c474880 100755 --- a/bootstrap/src/scripts/boot_as_master +++ b/bootstrap/src/scripts/boot_as_master @@ -88,6 +88,7 @@ sleep 10 # Setup LVM pvcreate $PARTITIONS vgcreate vg.01 $PARTITIONS +lvcreate -i $NUM_DEVS -I 64 -l 100%FREE -n lv_ephemeral vg.01 if [ "$cfn_encrypted_ephemeral" == "true" ]; then mkfs -q /dev/ram1 1024 mkdir -p /root/keystore @@ -99,7 +100,6 @@ if [ "$cfn_encrypted_ephemeral" == "true" ]; then mkfs.xfs /dev/mapper/ephemeral_luks mount -v -t xfs -o noatime,nodiratime /dev/mapper/ephemeral_luks /scratch else - lvcreate -i $NUM_DEVS -I 64 -l 100%FREE -n lv_ephemeral vg.01 mkfs.xfs /dev/vg.01/lv_ephemeral echo "/dev/vg.01/lv_ephemeral /scratch xfs noatime,nodiratime 0 0" >> /etc/fstab mount -v /scratch From 92fe8f3eaf1bc50168d53c2832c6da8b812f4489 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 18 Jun 2014 12:45:34 -0700 Subject: [PATCH 11/13] Fix: if syntax for pre/post args check --- bootstrap/src/scripts/boot_as_compute | 4 ++-- bootstrap/src/scripts/boot_as_master | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bootstrap/src/scripts/boot_as_compute b/bootstrap/src/scripts/boot_as_compute index 73d1cec0af..2aace4a50b 100755 --- a/bootstrap/src/scripts/boot_as_compute +++ b/bootstrap/src/scripts/boot_as_compute @@ -27,7 +27,7 @@ RC=0 if [ "${cfn_preinstall}" != "NONE" ]; then tmpfile=$(mktemp) wget -qO- ${cfn_preinstall} > $tmpfile || RC=1 - if [ "${cfn_preinstall_args}" != "NONE"]; then + if [ "${cfn_preinstall_args}" != "NONE" ]; then args=${cfn_preinstall_args} fi /bin/sh $tmpfile $args || RC=1 @@ -132,7 +132,7 @@ RC=0 if [ "${cfn_postinstall}" != "NONE" ]; then tmpfile=$(mktemp) wget -qO- ${cfn_postinstall} > $tmpfile || RC=1 - if [ "${cfn_postinstall_args}" != "NONE"]; then + if [ "${cfn_postinstall_args}" != "NONE" ]; then args=${cfn_postinstall_args} fi /bin/sh $tmpfile $args || RC=1 diff --git a/bootstrap/src/scripts/boot_as_master b/bootstrap/src/scripts/boot_as_master index 6f8c474880..082ecbb1bb 100755 --- a/bootstrap/src/scripts/boot_as_master +++ b/bootstrap/src/scripts/boot_as_master @@ -27,7 +27,7 @@ RC=0 if [ "${cfn_preinstall}" != "NONE" ]; then tmpfile=$(mktemp) wget -qO- ${cfn_preinstall} > $tmpfile || RC=1 - if [ "${cfn_preinstall_args}" != "NONE"]; then + if [ "${cfn_preinstall_args}" != "NONE" ]; then args=${cfn_preinstall_args} fi /bin/sh $tmpfile $args || RC=1 @@ -208,7 +208,7 @@ RC=0 if [ "${cfn_postinstall}" != "NONE" ]; then tmpfile=$(mktemp) wget -qO- ${cfn_postinstall} > $tmpfile || RC=1 - if [ "${cfn_postinstall_args}" != "NONE"]; then + if [ "${cfn_postinstall_args}" != "NONE" ]; then args=${cfn_postinstall_args} fi /bin/sh $tmpfile $args || RC=1 From 69e2882b2c2d878560d47f9ee1f0b1a532117f69 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 18 Jun 2014 14:01:00 -0700 Subject: [PATCH 12/13] Adding SSHFrom to config --- cli/cfncluster/cfnconfig.py | 5 +- cli/cfncluster/cli.py | 10 ++-- cli/cfncluster/examples/config | 10 ++++ cli/setup.py | 2 +- cloudformation/cfncluster.cfn.json | 74 ++++++++++++++++++++++++++++-- 5 files changed, 90 insertions(+), 11 deletions(-) diff --git a/cli/cfncluster/cfnconfig.py b/cli/cfncluster/cfnconfig.py index 127b600939..fc24ff6c79 100644 --- a/cli/cfncluster/cfnconfig.py +++ b/cli/cfncluster/cfnconfig.py @@ -116,7 +116,7 @@ def __init__(self, args): vpc_base_eni='VPCBaseNATENI1', compute_uses_public_subnet='ComputeUsesPublicSubnet', vpc_base_security_group='VPCBaseBackSecurityGroup', use_vpc_base='UseVPCBase', vpc_base_backend_subnet='VPCBaseBackendSubnet1', - availability_zones='AvailabilityZones') + availability_zones='AvailabilityZones', ssh_from='SSHFrom') # Loop over all VPC options and add define to parameters, raise Exception is defined but null for key in self.__vpc_options: @@ -136,7 +136,8 @@ def __init__(self, args): spot_price='SpotPrice', custom_ami='CustomAMI', pre_install='PreInstallScript', post_install='PostInstallScript', proxy_server='ProxyServer', iam_policy='IAMPolicy', placement='Placement', placement_group='PlacementGroup', - encrypted_ephemeral='EncryptedEphemeral') + encrypted_ephemeral='EncryptedEphemeral',pre_install_args='PreInstallArgs', + post_install_args='PostInstallArgs') # Loop over all the cluster options and add define to parameters, raise Exception if defined but null for key in self.__cluster_options: diff --git a/cli/cfncluster/cli.py b/cli/cfncluster/cli.py index ba4414b95a..4fc33c2b1b 100644 --- a/cli/cfncluster/cli.py +++ b/cli/cfncluster/cli.py @@ -76,11 +76,13 @@ def main(): pcreate.add_argument("--norollback", "-nr", action='store_true', dest="norollback", default=False, help='disable stack rollback on error') pcreate.add_argument("--template-url", "-u", type=str, dest="template_url", default=None, - help='disable stack rollback on error') + help='specify a URL for a custom cloudformation template') pcreate.add_argument("--cluster-template", "-t", type=str, dest="cluster_template", default=None, - help='specific a specific cluster template to use') + help='specify a specific cluster template to use') pcreate.add_argument("--extra-parameters", "-p", type=str, dest="extra_parameters", default=None, help='add extra parameters to stack create') + pcreate.add_argument("--tags", "-g", type=str, dest="tags", default=None, + help='tags to be added to the stack') pcreate.set_defaults(func=create) pupdate = subparsers.add_parser('update', help='update a running cluster') @@ -89,9 +91,9 @@ def main(): pupdate.add_argument("--norollback", "-nr", action='store_true', dest="norollback", default=False, help='disable stack rollback on error') pupdate.add_argument("--template-url", "-u", type=str, dest="template_url", default=None, - help='disable stack rollback on error') + help='specify a URL for a custom cloudformation template') pupdate.add_argument("--cluster-template", "-t", type=str, dest="cluster_template", default=None, - help='disable stack rollback on error') + help='specify a specific cluster template to use') pupdate.add_argument("--extra-parameters", "-p", type=str, dest="extra_parameters", default=None, help='add extra parameters to stack update') pupdate.add_argument("--reset-desired", "-rd", action='store_true', dest="reset_desired", default=False, diff --git a/cli/cfncluster/examples/config b/cli/cfncluster/examples/config index be17f08043..f72b033ddc 100644 --- a/cli/cfncluster/examples/config +++ b/cli/cfncluster/examples/config @@ -59,9 +59,15 @@ key_name = mykey # URL to a preinstall script. This is executed before any of the boot_as_* scripts are run # (defaults to NONE for the default template) #pre_install = NONE +# Arguments to be passed to preinstall script +# (defaults to NONE for the default template) +#pre_install_args = NONE # URL to a postinstall script. This is executed after any of the boot_as_* scripts are run # (defaults to NONE for the default template) #post_install = NONE +# Arguments to be passed to postinstall script +# (defaults to NONE for the default template) +#post_install_args = NONE # HTTP(S) proxy server, typically http://x.x.x.x:8080 # (defaults to NONE for the default template) #proxy_server = NONE @@ -91,6 +97,10 @@ public_subnet = subnet- # This is a comma delimited list and must always contain three values # Example: us-west-2a,NONE,NONE availability_zones = +# SSH from CIDR +# This is only used when cfncluster creates the security group +# (defaults to 0.0.0.0/0 in the default template) +#ssh_from = 0.0.0.0/0 #[vpc private] # Boolean flag to launch compute with direct egress or behind the Master server. diff --git a/cli/setup.py b/cli/setup.py index 0735537403..e5e52f767c 100644 --- a/cli/setup.py +++ b/cli/setup.py @@ -20,7 +20,7 @@ def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() console_scripts = ['cfncluster = cfncluster.cli:main'] -version = "0.0.6" +version = "0.0.7" setup( name = "cfncluster", diff --git a/cloudformation/cfncluster.cfn.json b/cloudformation/cfncluster.cfn.json index 19d1f05da1..06b06a8ab4 100644 --- a/cloudformation/cfncluster.cfn.json +++ b/cloudformation/cfncluster.cfn.json @@ -299,6 +299,16 @@ "true", "false" ] + }, + "PreInstallArgs" : { + "Description" : "Preinstall script args passed to the preinstall script.", + "Type" : "String", + "Default" : "NONE" + }, + "PostInstallArgs" : { + "Description" : "Postinstall script args passed to the postinstall script.", + "Type" : "String", + "Default" : "NONE" } }, "Conditions" : { @@ -417,12 +427,12 @@ } ] }, - "UseComputePlacement" : { + "UseClusterPlacement" : { "Fn::Equals" : [ { "Ref" : "Placement" }, - "compute" + "cluster" ] } }, @@ -797,6 +807,24 @@ "InstanceType" : { "Ref" : "MasterInstanceType" }, + "BlockDeviceMappings" : [ + { + "DeviceName" : "/dev/sdb", + "VirtualName" : "ephemeral0" + }, + { + "DeviceName" : "/dev/sdc", + "VirtualName" : "ephemeral1" + }, + { + "DeviceName" : "/dev/sdd", + "VirtualName" : "ephemeral2" + }, + { + "DeviceName" : "/dev/sde", + "VirtualName" : "ephemeral3" + } + ], "KeyName" : { "Ref" : "KeyName" }, @@ -909,9 +937,9 @@ "IamInstanceProfile" : { "Ref" : "RootInstanceProfile" }, - "PlacementGroup" : { + "PlacementGroupName" : { "Fn::If" : [ - "UseComputePlacement", + "UseClusterPlacement", { "Ref" : "PlacementGroup" }, @@ -947,11 +975,21 @@ "Ref" : "PreInstallScript" }, "\n", + "cfn_preinstall_args=", + { + "Ref" : "PreInstallArgs" + }, + "\n", "cfn_postinstall=", { "Ref" : "PostInstallScript" }, "\n", + "cfn_postinstall_args=", + { + "Ref" : "PostInstallArgs" + }, + "\n", "cfn_region=", { "Ref" : "AWS::Region" @@ -1150,6 +1188,24 @@ "InstanceType" : { "Ref" : "ComputeInstanceType" }, + "BlockDeviceMappings" : [ + { + "DeviceName" : "/dev/sdb", + "VirtualName" : "ephemeral0" + }, + { + "DeviceName" : "/dev/sdc", + "VirtualName" : "ephemeral1" + }, + { + "DeviceName" : "/dev/sdd", + "VirtualName" : "ephemeral2" + }, + { + "DeviceName" : "/dev/sde", + "VirtualName" : "ephemeral3" + } + ], "KeyName" : { "Ref" : "KeyName" }, @@ -1269,11 +1325,21 @@ "Ref" : "PreInstallScript" }, "\n", + "cfn_preinstall_args=", + { + "Ref" : "PreInstallArgs" + }, + "\n", "cfn_postinstall=", { "Ref" : "PostInstallScript" }, "\n", + "cfn_postinstall_args=", + { + "Ref" : "PostInstallArgs" + }, + "\n", "cfn_sqs_url=", { "Ref" : "SQS" From 1c38c85b6046428467ccae07720330ec8770a42c Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 18 Jun 2014 14:31:56 -0700 Subject: [PATCH 13/13] prepping for 0.0.7 release --- CHANGELOG.rst | 14 ++++++++++++++ amis.txt | 8 ++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3154e996e5..fa1e2d30f8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,20 @@ CHANGELOG ========= +0.0.7 +===== + +* feature:``cfncluster``: Added option to encrypt ephemeral drives with in-memory keys +* feature:``cfncluster``: Detect all ephemeral drives, stripe and mount as /scratch +* feature:``cfncluster``: Support for placement groups +* feature:``cfncluster``: Support for cluster placement logic. Can either be cluster or compute. +* feature:``cfncluster``: Added option to provides arguments to pre/post install scripts +* feature:``cfncluster``: Added DKMS support for Lustre filesystems - http://zfsonlinux.org/lustre.html +* bugfix:``cli``: Added missing support from SSH from CIDR range +* bugfix:``cfncluster``: Fixed Ganglia setup for ComputeFleet +* updates:``SGE``: Updated to 8.1.7 - https://arc.liv.ac.uk/trac/SGE +* updates:``Openlava``: Updated to latest Git for Openlava 2.2 - https://github.com/openlava/openlava + 0.0.6 ===== diff --git a/amis.txt b/amis.txt index 806514f64d..3d3a4e5586 100644 --- a/amis.txt +++ b/amis.txt @@ -1,4 +1,4 @@ -us-west-2 ami-e581fcd5 -us-east-1 ami-745ea11c -eu-west-1 ami-e3458c94 -ap-northeast-1 ami-2d41092c +us-west-2 ami-7dcab74d +us-east-1 ami-2c07f944 +eu-west-1 ami-a1a169d6 +ap-northeast-1 ami-b3c78fb2