Do not search for VM details like 'ID={vm_id}'
Query takes a long time and not ideal
This commit is contained in:
parent
f837e2b206
commit
927d4a029c
1 changed files with 2 additions and 7 deletions
|
@ -168,17 +168,12 @@ class OpenNebulaManager():
|
||||||
raise
|
raise
|
||||||
return user_pool
|
return user_pool
|
||||||
|
|
||||||
def _get_vm_pool(self, vm_id=None, infoextended=True):
|
def _get_vm_pool(self, infoextended=True):
|
||||||
"""
|
|
||||||
vm_id: int - the id of the VM that needs to looked up in the vm pool;
|
|
||||||
when set to None, looks for everything in the infoextended
|
|
||||||
"""
|
|
||||||
try:
|
try:
|
||||||
vm_pool = oca.VirtualMachinePool(self.client)
|
vm_pool = oca.VirtualMachinePool(self.client)
|
||||||
if infoextended:
|
if infoextended:
|
||||||
vm_pool.infoextended(
|
vm_pool.infoextended(
|
||||||
filter_key_value_str='ID={vm_id}'.format(vm_id=vm_id) if
|
filter=-1,
|
||||||
vm_id is not None else '',
|
|
||||||
vm_state=-1 # Look for VMs in any state, except DONE
|
vm_state=-1 # Look for VMs in any state, except DONE
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue