azure_rm_virtualmachine : fix support for existing machines provisioned with a managed image (#32984)

pull/44255/merge
Jean-Bernard Jansen 6 years ago committed by Yunge Zhu
parent d5cbb53f5a
commit 390a08c781

@ -1127,6 +1127,8 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
disk_size_gb=vm_dict['properties']['storageProfile']['osDisk']['diskSizeGB'] disk_size_gb=vm_dict['properties']['storageProfile']['osDisk']['diskSizeGB']
), ),
image_reference=self.compute_models.ImageReference( image_reference=self.compute_models.ImageReference(
id=vm_dict['properties']['storageProfile']['imageReference']['id'],
) if 'id' in vm_dict['properties']['storageProfile']['imageReference'].keys() else self.compute_models.ImageReference(
publisher=vm_dict['properties']['storageProfile']['imageReference']['publisher'], publisher=vm_dict['properties']['storageProfile']['imageReference']['publisher'],
offer=vm_dict['properties']['storageProfile']['imageReference']['offer'], offer=vm_dict['properties']['storageProfile']['imageReference']['offer'],
sku=vm_dict['properties']['storageProfile']['imageReference']['sku'], sku=vm_dict['properties']['storageProfile']['imageReference']['sku'],

Loading…
Cancel
Save