Add some sample VMs

This commit is contained in:
Nico Schottelius 2020-08-02 00:55:07 +02:00
commit e563780142
5 changed files with 129 additions and 49 deletions

View file

@ -58,31 +58,74 @@ class Command(BaseCommand):
owner=user,
size_in_gb=30)
order_vm_25206 = Order.objects.create(owner=user,
billing_address=addr,
starting_date=timezone.make_aware(datetime.datetime(2020,3,3)),
recurring_period=RecurringPeriod.PER_30D,
recurring_price = vm_price_2020(cpu=1, ram=4) / 2,
description = "VM %s" % vm25206
)
order_vm_25206_ssd = Order.objects.create(owner=user,
billing_address=addr,
starting_date=timezone.make_aware(datetime.datetime(2020,3,3)),
recurring_period=RecurringPeriod.PER_30D,
recurring_price = disk_price_2020(30, VMDiskType.CEPH_SSD) / 2,
description = vm25206_ssd
)
vm25206.cores = 2
vm25206.ram_in_gb = 8
vm25206.save()
vm25206.create_or_update_order(when_to_start=timezone.make_aware(datetime.datetime(2020,4,17)))
order_vm_25206_growing = Order.objects.create(owner=user,
billing_address=addr,
starting_date=timezone.make_aware(datetime.datetime(2020,4,17)),
recurring_period=RecurringPeriod.PER_30D,
recurring_price = vm_price_2020(cpu=2, ram=8) / 2,
replaces=order_vm_25206,
description = "VM %s" % vm25206
)
vm25206_ssd.size_in_gb = 50
vm25206_ssd.save()
vm25206_ssd.create_or_update_order(when_to_start=timezone.make_aware(datetime.datetime(2020,8,5)))
vm25615 = VMProduct.objects.create(name="OpenNebula 25615",
cores=1,
ram_in_gb=4,
owner=user)
vm25615_ssd = VMDiskProduct.objects.create(vm=vm25615,
owner=user,
size_in_gb=30)
vm25615.cores = 2
vm25615.ram_in_gb = 8
vm25615.save()
vm25615.create_or_update_order(when_to_start=timezone.make_aware(datetime.datetime(2020,4,17)))
vm25615_ssd.size_in_gb = 50
vm25615_ssd.save()
vm25615_ssd.create_or_update_order(when_to_start=timezone.make_aware(datetime.datetime(2020,8,5)))
vm25208 = VMProduct.objects.create(name="OpenNebula 25208",
cores=1,
ram_in_gb=4,
owner=user)
vm25208_ssd = VMDiskProduct.objects.create(vm=vm25208,
owner=user,
size_in_gb=30)
vm25208.cores = 2
vm25208.ram_in_gb = 8
vm25208.save()
vm25208.create_or_update_order(when_to_start=timezone.make_aware(datetime.datetime(2020,4,17)))
vm25208_ssd.size_in_gb = 50
vm25208_ssd.save()
vm25208_ssd.create_or_update_order(when_to_start=timezone.make_aware(datetime.datetime(2020,8,5)))
vm25207 = VMProduct.objects.create(name="OpenNebula 25207",
cores=1,
ram_in_gb=4,
owner=user)
vm25207_ssd = VMDiskProduct.objects.create(vm=vm25207,
owner=user,
size_in_gb=30)
vm25207_ssd.size_in_gb = 50
vm25207_ssd.save()
vm25207_ssd.create_or_update_order(when_to_start=timezone.make_aware(datetime.datetime(2020,8,5)))
vm25207.cores = 2
vm25207.ram_in_gb = 8
vm25207.save()
vm25207.create_or_update_order(when_to_start=timezone.make_aware(datetime.datetime(2020,6,19)))
# FIXES: check starting times (they are slightly different)
# add vm 25236