1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-07-09 04:55:41 +00:00

Instances overhaul

This commit is contained in:
Real-Gecko 2020-07-13 15:33:09 +06:00
parent f23e6b000f
commit 47009d47ca
69 changed files with 5011 additions and 4127 deletions

View file

@ -0,0 +1,35 @@
# Generated by Django 2.2.10 on 2020-01-28 07:01
from django.db import migrations
def add_flavors(apps, schema_editor):
Flavor = apps.get_model("instances", "Flavor")
add_flavor = Flavor(label="micro", vcpu="1", memory="512", disk="20")
add_flavor.save()
add_flavor = Flavor(label="mini", vcpu="2", memory="1024", disk="30")
add_flavor.save()
add_flavor = Flavor(label="small", vcpu="2", memory="2048", disk="40")
add_flavor.save()
add_flavor = Flavor(label="medium", vcpu="2", memory="4096", disk="60")
add_flavor.save()
add_flavor = Flavor(label="large", vcpu="4", memory="8192", disk="80")
add_flavor.save()
add_flavor = Flavor(label="xlarge", vcpu="8", memory="16384", disk="160")
add_flavor.save()
def del_flavors(apps, schema_editor):
Flavor = apps.get_model("instances", "Flavor")
Flavor.objects.all().delete()
class Migration(migrations.Migration):
dependencies = [
('instances', '0005_flavor'),
]
operations = [
migrations.RunPython(add_flavors, del_flavors),
]