diff --git a/plugins/modules/azure_rm_manageddisk.py b/plugins/modules/azure_rm_manageddisk.py index 96f58d644..36af7ca69 100644 --- a/plugins/modules/azure_rm_manageddisk.py +++ b/plugins/modules/azure_rm_manageddisk.py @@ -637,7 +637,7 @@ def get_managed_disk(self): def is_attach_caching_option_different(self, vm_name, disk): resp = False if vm_name: - vm = self._get_vm(vm_name) + vm = self._get_vm(self.resource_group, vm_name) correspondence = next((d for d in vm.storage_profile.data_disks if d.name.lower() == disk.get('name').lower()), None) caching_options = self.compute_models.CachingTypes[self.attach_caching] if self.attach_caching and self.attach_caching != '' else None if correspondence and correspondence.caching != caching_options: