diff --git a/plugins/modules/azure_rm_manageddisk.py b/plugins/modules/azure_rm_manageddisk.py index 4c6dfe1fc..726728022 100644 --- a/plugins/modules/azure_rm_manageddisk.py +++ b/plugins/modules/azure_rm_manageddisk.py @@ -66,6 +66,11 @@ - empty - import - copy + storage_account_id: + description: + - The full path to the storage account the image is to be imported from. + - Required when I(create_option=import). + type: str source_uri: description: - URI to a valid VHD file to be used or the resource ID of the managed disk to copy. @@ -139,6 +144,7 @@ resource_group: myResourceGroup create_option: import source_uri: https://storageaccountname.blob.core.windows.net/containername/blob-name.vhd + storage_account_id: /subscriptions//resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/storageaccountname os_type: windows storage_account_type: Premium_LRS @@ -197,6 +203,11 @@ - Create option of the disk. type: str sample: copy + storage_account_id: + description: + - The full path to the storage account the image is to be imported from + type: str + sample: /subscriptions//resourceGroups//providers/Microsoft.Storage/storageAccounts/ source_uri: description: - URI to a valid VHD file to be used or the resource ID of the managed disk to copy. @@ -285,6 +296,9 @@ def __init__(self): type='str', choices=['empty', 'import', 'copy'] ), + storage_account_id=dict( + type='str' + ), source_uri=dict( type='str', aliases=['source_resource_uri'] @@ -312,7 +326,7 @@ def __init__(self): ) ) required_if = [ - ('create_option', 'import', ['source_uri']), + ('create_option', 'import', ['source_uri', 'storage_account_id']), ('create_option', 'copy', ['source_uri']), ('create_option', 'empty', ['disk_size_gb']) ] @@ -325,6 +339,7 @@ def __init__(self): self.location = None self.storage_account_type = None self.create_option = None + self.storage_account_id = None self.source_uri = None self.os_type = None self.disk_size_gb = None @@ -455,6 +470,7 @@ def generate_managed_disk_property(self): if self.create_option == 'import': creation_data['create_option'] = self.compute_models.DiskCreateOption.import_enum creation_data['source_uri'] = self.source_uri + creation_data['source_account_id'] = self.storage_account_id elif self.create_option == 'copy': creation_data['create_option'] = self.compute_models.DiskCreateOption.copy creation_data['source_resource_id'] = self.source_uri