rename opennebula commands

This commit is contained in:
Nico Schottelius 2020-03-17 14:49:49 +01:00
parent 8356404fe4
commit ac7ea86668
3 changed files with 6 additions and 6 deletions

View File

@ -57,17 +57,17 @@ class Command(BaseCommand):
usable_ram_in_kb = int(host_share.get('TOTAL_MEM', 0))
usable_ram_in_gb = int(usable_ram_in_kb / 2 ** 20)
vms = host.get('VMS', {}) or {}
vms = vms.get('ID', []) or []
vms = ','.join(vms)
# vms cannot be created like this -- Nico, 2020-03-17
# vms = host.get('VMS', {}) or {}
# vms = vms.get('ID', []) or []
# vms = ','.join(vms)
VMHost.objects.update_or_create(
hostname=host_name,
defaults={
'usable_cores': usable_cores,
'usable_ram_in_gb': usable_ram_in_gb,
'status': status,
'vms': vms
'status': status
}
)
else:

View File

@ -83,7 +83,7 @@ class Command(BaseCommand):
def handle(self, *args, **options):
for one_vm in VMModel.objects.all():
# Host on which the VM is currently residing
host = VMHost.objects.filter(vms__icontains=one_vm.vmid).first()
#host = VMHost.objects.filter(vms__icontains=one_vm.vmid).first()
# VCPU, RAM, Owner, Status
# TODO: Set actual status instead of hard coded 'active'