I was researching how to use LVM for the Linux blueprints with the Guest Agent. I didn't find anything, actually, on how to achieve this.
But searching for the scripts inside the gugent I found one named "_30_DiskSetupLVM.sh"
I proceeded to replate the standard script with this one, so I simply renamed the script to "30_DiskSetup.sh" which is what the gugent actually calls when Customizing the VM.
It actually works!
Now when a Linux VM is created and an additional Disk is requested, it will extend the VG with the new disk. It will also mount it as requested with the filesystem formated as requested.
I don't know if this common knowledge but I hope someone find this usefull.
The only issue I have is that it extends the root VG, and does not create a new one. We usually have a second VG with all the data and one VG for the OS. We could live with two separate VGs, even though we sometimes need more than 2 VGs.
Does anyone know how to do this? Creating a second VG and adding the disks provisioned at request time to this VG would be exactly what we need.
I'll attach the script. I'm not proficient in linux nor scripting, but it looks like it lists the available VG and extend it. I don't know what would happen if there were more than 1 VG.
Thanks in advance.