forked from uncloud/uncloud
phase in notion of a product
This commit is contained in:
parent
55a2de72c8
commit
3b508fc87d
3 changed files with 100 additions and 4 deletions
|
|
@ -41,6 +41,7 @@ import logging
|
|||
from uncloud.hack.db import DB
|
||||
from uncloud.hack.mac import MAC
|
||||
from uncloud.vmm import VMM
|
||||
from uncloud.hack.product import Product
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
log.setLevel(logging.DEBUG)
|
||||
|
|
@ -71,11 +72,15 @@ class VM(object):
|
|||
self.image_format='qcow2'
|
||||
|
||||
# External components.
|
||||
self.vmm = VMM(vmm_backend=self.hackprefix)
|
||||
|
||||
# This one is broken:
|
||||
# TypeError: expected str, bytes or os.PathLike object, not NoneType
|
||||
# Fix before re-enabling
|
||||
# self.vmm = VMM(vmm_backend=self.hackprefix)
|
||||
self.mac = MAC(self.config)
|
||||
|
||||
# Harcoded & generated values.
|
||||
self.owner = 'uncoud'
|
||||
self.owner = 'uncloud'
|
||||
self.accel = 'kvm'
|
||||
self.threads = 1
|
||||
self.ifup = os.path.join(self.hackprefix, "ifup.sh")
|
||||
|
|
@ -84,6 +89,12 @@ class VM(object):
|
|||
|
||||
self.vm = {}
|
||||
|
||||
self.product = Product(config, product_name="dualstack-vm")
|
||||
|
||||
self.features = []
|
||||
# self.features.append(self.define_feature(
|
||||
# self.super().__init__(
|
||||
|
||||
def get_qemu_args(self):
|
||||
command = (
|
||||
"-name {owner}-{name}"
|
||||
|
|
@ -104,6 +115,9 @@ class VM(object):
|
|||
|
||||
return command.split(" ")
|
||||
|
||||
def create_db_entry(self):
|
||||
pass
|
||||
|
||||
def create(self):
|
||||
# New VM: new UUID, new MAC.
|
||||
self.uuid = str(uuid.uuid4())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue