From 56228c58801e2c3c8918b413d50e4f6db6fb11ec Mon Sep 17 00:00:00 2001 From: Maxence Date: Fri, 12 Nov 2021 01:22:51 +0000 Subject: [PATCH] Add managed disk ID to returned facts for data disks --- plugins/modules/azure_rm_virtualmachine_info.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/modules/azure_rm_virtualmachine_info.py b/plugins/modules/azure_rm_virtualmachine_info.py index 034b922a7..bbc0fa851 100644 --- a/plugins/modules/azure_rm_virtualmachine_info.py +++ b/plugins/modules/azure_rm_virtualmachine_info.py @@ -136,6 +136,12 @@ returned: always type: str sample: Standard_LRS + managed_disk_id: + description: + - Managed data disk ID. + returned: always + type: str + sample: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/Microsoft.Compute/disks/diskName id: description: - Resource ID. @@ -439,6 +445,7 @@ def serialize_vm(self, vm): 'name': disks[disk_index].get('name'), 'disk_size_gb': disks[disk_index].get('diskSizeGB'), 'managed_disk_type': disks[disk_index].get('managedDisk', {}).get('storageAccountType'), + 'managed_disk_id': disks[disk_index].get('managedDisk', {}).get('id'), 'caching': disks[disk_index].get('caching') })