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

This commit is contained in:
Jean-Bernard Jansen 2018-08-28 11:33:16 +02:00 committed by Yunge Zhu
parent d5cbb53f5a
commit 390a08c781

View file

@ -1127,6 +1127,8 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
disk_size_gb=vm_dict['properties']['storageProfile']['osDisk']['diskSizeGB']
),
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'],
offer=vm_dict['properties']['storageProfile']['imageReference']['offer'],
sku=vm_dict['properties']['storageProfile']['imageReference']['sku'],