diff --git a/Vagrantfile b/Vagrantfile index 9d24953..e49dcf6 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,10 +6,10 @@ Vagrant.configure(2) do |config| config.vm.hostname = "webvirtmgr" config.vm.network "private_network", ip: "192.168.33.10" config.vm.provision "shell", inline: <<-SHELL - sudo sh /vagrant/dev-env/libvirt-bootstrap.sh + sudo sh /vagrant/development/libvirt-bootstrap.sh sudo sed -i 's/auth_tcp = \"sasl\"/auth_tcp = \"none\"/g' /etc/libvirt/libvirtd.conf sudo service libvirt-bin restart sudo apt-get -y install python-pip python-dev python-libvirt python-libxml2 - sudo pip install -r /vagrant/dev-env/requirements.txt + sudo pip install -r /vagrant/development/requirements.txt SHELL end diff --git a/accounts/migrations/0002_auto_20150227_1353.py b/accounts/migrations/0002_auto_20150227_1353.py new file mode 100644 index 0000000..f753cb0 --- /dev/null +++ b/accounts/migrations/0002_auto_20150227_1353.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('accounts', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='userinstance', + name='is_change', + field=models.BooleanField(default=False), + preserve_default=True, + ), + migrations.AddField( + model_name='userinstance', + name='is_delete', + field=models.BooleanField(default=False), + preserve_default=True, + ), + ] diff --git a/create/fixtures/initial_data.json b/create/fixtures/initial_data.json new file mode 100644 index 0000000..d5d17b0 --- /dev/null +++ b/create/fixtures/initial_data.json @@ -0,0 +1,62 @@ +[ + { + "model": "create.Flavor", + "pk": 1, + "fields": { + "label": "micro", + "vcpu": "1", + "memory": "512", + "disk": "20" + } + }, + { + "model": "create.Flavor", + "pk": 2, + "fields": { + "label": "mini", + "vcpu": "2", + "memory": "1024", + "disk": "30" + } + }, + { + "model": "create.Flavor", + "pk": 3, + "fields": { + "label": "small", + "vcpu": "2", + "memory": "2048", + "disk": "40" + } + }, + { + "model": "create.Flavor", + "pk": 4, + "fields": { + "label": "medium", + "vcpu": "2", + "memory": "4096", + "disk": "60" + } + }, + { + "model": "create.Flavor", + "pk": 5, + "fields": { + "label": "large", + "vcpu": "4", + "memory": "8192", + "disk": "80" + } + }, + { + "model": "create.Flavor", + "pk": 6, + "fields": { + "label": "xlarge", + "vcpu": "8", + "memory": "16384", + "disk": "160" + } + } +] \ No newline at end of file diff --git a/create/migrations/0001_initial.py b/create/migrations/0001_initial.py new file mode 100644 index 0000000..030ee30 --- /dev/null +++ b/create/migrations/0001_initial.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Flavor', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('label', models.CharField(max_length=12)), + ('memory', models.IntegerField()), + ('vcpu', models.IntegerField()), + ('disk', models.IntegerField()), + ], + options={ + }, + bases=(models.Model,), + ), + ] diff --git a/dev-env/libvirt-bootstrap.sh b/development/libvirt-bootstrap.sh similarity index 100% rename from dev-env/libvirt-bootstrap.sh rename to development/libvirt-bootstrap.sh diff --git a/dev-env/requirements.txt b/development/requirements.txt similarity index 100% rename from dev-env/requirements.txt rename to development/requirements.txt diff --git a/webvirtcloud/settings.py b/webvirtcloud/settings.py index 146dcaa..c49a295 100644 --- a/webvirtcloud/settings.py +++ b/webvirtcloud/settings.py @@ -24,6 +24,7 @@ INSTALLED_APPS = ( 'computes', 'instances', 'accounts', + 'create', ) MIDDLEWARE_CLASSES = ( @@ -85,4 +86,8 @@ WS_CERT = None QEMU_CONSOLE_TYPES = ['vnc', 'spice'] # default console type -QEMU_CONSOLE_DEFAULT_TYPE = 'vnc' \ No newline at end of file +QEMU_CONSOLE_DEFAULT_TYPE = 'vnc' + +# keepalive interval and count for libvirt connections +LIBVIRT_KEEPALIVE_INTERVAL = 5 +LIBVIRT_KEEPALIVE_COUNT = 5