I'm looking to create a command-line script that upgrades the data disks of existing virtual machines to the Premium SSD v2 type. My focus is on whether I should handle this on the Azure side or through other systems like Active Directory or a CMDB. Additionally, I'd like guidance on ensuring that the hostname remains consistent when I create a new VM to facilitate this upgrade, as the current VMs are in Availability Sets and I want to transition to Availability Zones. Any insights on the best method to achieve this would be appreciated!
3 Answers
Just give it a go! Testing is often the best way to inform your approach. But I have to say, if the conversation hasn’t yielded much feedback so far, it might be time to step away from automated solutions and explore practical ones.
Are you asking if you should create a new disk or upgrade the SKU of an existing one? These are two distinct actions that may lead to confusion.
I don’t really understand why you think upgrading the data disk would change the hostname. If you're upgrading to SSD v2 and the VM is in an Availability Set (AS), you’ll need to create a new VM in an Availability Zone (AZ) for that upgrade. Make sure you reference the Azure docs for converting managed disk types for clarity on this process.

Thanks for the clarification! I appreciate the pointer. I'm mainly concerned with the upgrade process due to the need to change from AS to AZ and keeping the hostname intact.