uncloud-mravi/uncloud/management/commands/uncloud.py

28 lines
791 B
Python

import sys
from datetime import datetime
from django.core.management.base import BaseCommand
from django.contrib.auth import get_user_model
from opennebula.models import VM as VMModel
from uncloud_vm.models import VMHost, VMProduct, VMNetworkCard, VMDiskImageProduct, VMDiskProduct, VMCluster
import logging
log = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'General uncloud commands'
def add_arguments(self, parser):
parser.add_argument('--bootstrap', action='store_true', help='Bootstrap a typical uncloud installation')
def handle(self, *args, **options):
if options['bootstrap']:
self.bootstrap()
def bootstrap(self):
default_cluster = VMCluster.objects.get_or_create(name="default")
# local_host =