fabianlee / tf-vsphere-singlevm-from-template

12 stars 6 forks source link

Thanks! #1

Open joakimkingstrom opened 1 year ago

joakimkingstrom commented 1 year ago

I'm fairly new to github but just wanted to give my thanks for the ubuntu templatising scripts! It's made my job a lot easier :)

I added the below bit, which will extend the disk if needed, to the rc.local file in my own my own template. I figured I'd share it just in case you might want to add it to your own script (since a cloned machine often has a different sized disk).

# Extend disk 
parted /dev/sda resizepart 3 -s
if [ $? -ne 0 ]; then
    echo "Nothing to do"
else
    growpart /dev/sda 3
    pvresize /dev/sda3
    lvresize -l+100%FREE --resizefs /dev/mapper/ubuntu--vg-ubuntu--lv
fi
bastiao commented 1 year ago

this seems valuable to add to the script! I did not test, but the capability to grow disk space is indeed useful.