Skip to content

Commit 44f183c

Browse files
Fix cs_instance for existing instance if account/domain is set (#109)
Currently, when using cs_instance with an existing instance with a specified root_disk_size, the module invocation fails when a domain or account is specified, because the listVolume request does not include these parameters. A similar issue has recently been solved for projects (#90).
1 parent 24d1733 commit 44f183c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plugins/modules/cs_instance.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,14 @@ def update_instance(self, instance, start_vm=True):
832832
root_disk_size_changed = False
833833

834834
if root_disk_size is not None:
835-
res = self.query_api('listVolumes', type='ROOT', virtualmachineid=instance['id'], projectid=instance.get('projectid'))
835+
args = {
836+
'type': 'ROOT',
837+
'virtualmachineid': instance['id'],
838+
'account': instance.get('account'),
839+
'domainid': instance.get('domainid'),
840+
'projectid': instance.get('projectid'),
841+
}
842+
res = self.query_api('listVolumes', **args)
836843
[volume] = res['volume']
837844

838845
size = volume['size'] >> 30

0 commit comments

Comments
 (0)