# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-09-01 10:14
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='DataCenter',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=32, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Datastore',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=64, unique=True)),
                ('description', models.CharField(max_length=256)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DnsRecord',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=64)),
                ('type', models.CharField(max_length=8)),
                ('data', models.CharField(max_length=64)),
                ('ttl', models.PositiveIntegerField(default=3600, help_text='[sec]')),
                ('priority', models.PositiveIntegerField(null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Environment',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HypervisorHost',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=64, unique=True)),
                ('reserved', models.BooleanField(default=False)),
                ('cpu_core_num_for_vm', models.PositiveIntegerField(help_text='[Core]')),
                ('memory_capacity_for_vm', models.PositiveIntegerField(help_text='[GB]')),
                ('hdd_capacity_for_vm', models.PositiveIntegerField(help_text='[GB]')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='nfs_storage',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=256)),
                ('description', models.CharField(max_length=256)),
                ('ipaddr', models.GenericIPAddressField()),
                ('capacity', models.PositiveIntegerField(help_text='[GB]')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OperatingSystem',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PhysicalServer',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=64, unique=True)),
                ('serial', models.CharField(max_length=64, unique=True)),
                ('cpu_core_num', models.PositiveIntegerField(help_text='[Core]')),
                ('cpu_socket_num', models.PositiveIntegerField(help_text='use this field for License Evaluation')),
                ('memory_capacity', models.PositiveIntegerField(help_text='[GB]')),
                ('hdd_capacity', models.PositiveIntegerField(help_text='[GB]')),
                ('rack_unit_start', models.PositiveIntegerField()),
                ('rack_unit_end', models.PositiveIntegerField()),
                ('environment', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.Environment')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PhysicalServerProduct',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=128, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Rack',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=64, unique=True)),
                ('serial', models.CharField(max_length=128)),
                ('console', models.CharField(blank=True, max_length=64)),
                ('num_of_unit', models.IntegerField(default=32)),
                ('environment', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.Environment')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VCenterCluster',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=64, unique=True)),
                ('usage', models.CharField(max_length=128)),
                ('HA_available', models.BooleanField()),
                ('DataCenter', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.DataCenter')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VirtualMachine',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=64, unique=True)),
                ('usage', models.CharField(max_length=256)),
                ('cpu', models.PositiveIntegerField(help_text='[core]')),
                ('memory', models.PositiveIntegerField(help_text='[GB]')),
                ('HA_required', models.BooleanField()),
                ('hypervisorhost', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.HypervisorHost')),
                ('os', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.OperatingSystem')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VLAN',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('VLAN_ID', models.IntegerField(unique=True)),
                ('usage', models.CharField(max_length=256)),
                ('nwaddr', models.GenericIPAddressField()),
                ('prefix', models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(128)])),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VmAttachedVirtualHDD',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('mount_point', models.CharField(max_length=256)),
                ('capacity', models.PositiveIntegerField(help_text='[GB]')),
                ('datastore', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.Datastore')),
                ('virtualmachine', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ServerAdmin.VirtualMachine')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VmAttachedVirtualNIC',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('IP_Address', models.GenericIPAddressField(unique=True)),
                ('vLAN_ID', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.VLAN')),
                ('virtualmachine', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ServerAdmin.VirtualMachine')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VmChefRecipe',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=128, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VmInstalledSoftware',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=128, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VmServerSpecTest',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=128, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Volume',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('modified_time', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=256)),
                ('description', models.CharField(max_length=256)),
                ('path', models.CharField(max_length=128)),
                ('capacity', models.PositiveIntegerField(help_text='[GB]')),
                ('storage', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.nfs_storage')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='virtualmachine',
            name='vmchefrecipe',
            field=models.ManyToManyField(to='ServerAdmin.VmChefRecipe'),
        ),
        migrations.AddField(
            model_name='virtualmachine',
            name='vminstalledsoftware',
            field=models.ManyToManyField(to='ServerAdmin.VmInstalledSoftware'),
        ),
        migrations.AddField(
            model_name='virtualmachine',
            name='vmserverspectest',
            field=models.ManyToManyField(to='ServerAdmin.VmServerSpecTest'),
        ),
        migrations.AddField(
            model_name='physicalserver',
            name='product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.PhysicalServerProduct'),
        ),
        migrations.AddField(
            model_name='physicalserver',
            name='rack',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.Rack'),
        ),
        migrations.AddField(
            model_name='hypervisorhost',
            name='PhysicalServer',
            field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.PhysicalServer'),
        ),
        migrations.AddField(
            model_name='hypervisorhost',
            name='vCenterCluster',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.VCenterCluster'),
        ),
        migrations.AddField(
            model_name='datastore',
            name='storage',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.Volume'),
        ),
        migrations.AddField(
            model_name='datacenter',
            name='environment',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ServerAdmin.Environment'),
        ),
    ]
