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.
This commit is contained in:
Rene Moser 2015-06-26 10:04:19 +02:00 committed by Matt Clay
parent 6fd10bed8f
commit cbfc5a3079

View file

@ -439,8 +439,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
args['account'] = self.get_account(key='name') args['account'] = self.get_account(key='name')
args['domainid'] = self.get_domain(key='id') args['domainid'] = self.get_domain(key='id')
args['projectid'] = self.get_project(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) instances = self.cs.listVirtualMachines(**args)
if instances: if instances:
for v in instances['virtualmachine']: for v in instances['virtualmachine']: