I am trying to replace OS disk of an existing VM with a OS created from previous snapshot of the same VM. while doing this i am getting below error -
----------
File "azure.py", line 132, in vmcreate
GenericError: Changing property 'osDisk.createOption' is not allowed.
----------
I am performing following steps -
1. Create OS disk from from previous snapshot of the same VM (using computeclient.disks.create_or_update())
2. Deallocate VM (using computeclient.virtual_machines.deallocate())
3. Update VM (using computeclient.virtual_machines.create_or_update())after setting below VM parameters.
vm.storage_profile.os_disk = OSDisk("attach")
vm.storage_profile.os_disk.caching = 'ReadWrite'
vm.storage_profile.os_disk.create_option = "attach"
vm.storage_profile.os_disk.os_type = 'Linux'
vm.storage_profile.data_disks = disklist <<< list of data disks
Am i missing anything here?