resize stemcell

size=5000
wget https://bosh-jenkins-artifacts.s3.amazonaws.com/bosh-stemcell/aws/bosh-stemcell-2641-aws-xen-ubuntu-trusty-go_agent.tgz
rm -rf newsc
mkdir -p newsc
cd newsc
tar xf ../bosh-stemcell-2641-aws-xen-ubuntu-trusty-go_agent.tgz
tar xf image
dd if=/dev/null of=new.img bs=1M seek=$size
sudo virt-resize root.img new.img –expend /dev/sda1
rm -f image root.img
mv new.img root.img
tar czf image root.img
rm -f root.img
echo " disk: ${size}” » stemcell.MF
sha=shasum -a 1 image |cut -f1 -d ' '
sed -i -e “s/^sha1.*/sha1: $sha/” stemcell.MF
sed -i -e “s/bosh-aws-xen-ubuntu-trusty-go_agent/bosh-aws-xen-ubuntu-trusty-go_agent-jumpbox/” stemcell.MF
tar czf ../newsc.tgz *
cd ..

你可能感兴趣的:(resize stemcell)