From cbfc5a3079a4bb9bc34b97d19c465662970b0109 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Fri, 26 Jun 2015 10:04:19 +0200 Subject: [PATCH] cloudstack: cs_instance do not pass zoneid to listVirtualMachines This change is related to 2 issues; - The API does not return destroyed VMs if zone ID is passed for CS version < 4.5.2. Also see CLOUDSTACK-8578. This only affects domain and root admins. - The instance name must be unique across all zones. If we pass the zone ID to find a VM, it will not be found if it is in a different zone but a deployment with the name would fail. --- lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py b/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py index 898f488bb8..321e03023b 100644 --- a/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py +++ b/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py @@ -439,8 +439,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack): args['account'] = self.get_account(key='name') args['domainid'] = self.get_domain(key='id') args['projectid'] = self.get_project(key='id') - args['zoneid'] = self.get_zone(key='id') - + # Do not pass zoneid, as the instance name must be unique across zones. instances = self.cs.listVirtualMachines(**args) if instances: for v in instances['virtualmachine']: