# Generated by Django 2.2 on 2021-06-16 08:45

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Server',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ip', models.GenericIPAddressField(db_index=True, help_text='IP地址', verbose_name='管理ip')),
                ('hostname', models.CharField(db_index=True, help_text='主机名', max_length=32, verbose_name='主机名')),
                ('cpu', models.CharField(help_text='cpu型号', max_length=256, verbose_name='CPU')),
                ('cpu_core', models.IntegerField(help_text='cpu核数', verbose_name='cpu核数')),
                ('memory', models.CharField(help_text='内存', max_length=32, verbose_name='内存')),
                ('disk', models.CharField(help_text='磁盘', max_length=200, verbose_name='磁盘')),
                ('os', models.CharField(help_text='系统版本', max_length=50, verbose_name='操作系统')),
                ('model_name', models.CharField(blank=True, help_text='服务器型号', max_length=32, null=True, verbose_name='服务器型号')),
                ('rmt_card_ip', models.CharField(blank=True, db_index=True, help_text='管理卡IP', max_length=15, null=True, verbose_name='管理卡IP')),
                ('idc', models.CharField(blank=True, help_text='所在机房', max_length=32, null=True, verbose_name='所在机房')),
                ('cabinet', models.CharField(blank=True, help_text='所在机柜', max_length=32, null=True, verbose_name='所在机柜')),
                ('cabinet_position', models.CharField(help_text='机柜内位置', max_length=20, null=True, verbose_name='机柜内位置')),
                ('server_type', models.CharField(choices=[('Physical', '物理机'), ('Opencloud', 'opencloud'), ('Ruiyun', '瑞云'), ('Aliyun', '阿里云')], default='Physical', help_text='服务器类型', max_length=32, verbose_name='服务器类型')),
                ('last_check', models.DateTimeField(auto_now=True, help_text='上次检测时间', verbose_name='上次检测时间')),
                ('remark', models.CharField(help_text='备注', max_length=200, null=True, verbose_name='备注')),
                ('status', models.CharField(choices=[('disable', '不可用'), ('enable', '可用')], default='enable', help_text='状态', max_length=10, verbose_name='状态')),
                ('gpu_type', models.CharField(blank=True, help_text='GPU类型', max_length=32, null=True, verbose_name='GPU类型')),
                ('borrow', models.CharField(blank=True, max_length=256, null=True, verbose_name='借用')),
                ('project', models.CharField(blank=True, max_length=256, null=True, verbose_name='项目/产品')),
                ('asset', models.CharField(blank=True, max_length=256, null=True, verbose_name='资产号')),
                ('owner', models.ManyToManyField(blank=True, help_text='服务器负责人', null=True, related_name='owner', to=settings.AUTH_USER_MODEL, verbose_name='服务器负责人')),
            ],
            options={
                'ordering': ['-last_check'],
            },
        ),
    ]
