rename default lvm name from vm to lvm

This commit is contained in:
deflax 2018-02-04 20:30:32 +02:00
parent 7a81f35c93
commit 52828f6ca6

View file

@ -59,7 +59,7 @@ def create(json):
vm_name = unidecode(vm_name_utf8)
image_name = 'vm-' + str(phy_id) + '-disk-1'
try:
local_storage = proxobject.nodes(real_slave_name).storage('vm')
local_storage = proxobject.nodes(real_slave_name).storage('lvm')
storage_create_result = local_storage.content.post(vmid=phy_id, filename=image_name, size=json['hdd'] + 'G')
ioconfig.logger.info('%s[%s]> allocated %s as %s' % (json['clientemail'], slave_name, json['hdd'], image_name))
except:
@ -74,7 +74,7 @@ def create(json):
cores=json['cpu'],
memory=json['mem'],
scsihw='virtio-scsi-pci',
scsi0='file=vm:' + image_name + ',discard=on',
scsi0='file=lvm:' + image_name + ',discard=on',
net0='virtio=8A:32:CD:E4:EE:11,bridge=' + json['net0if'] + ',tag=' + str(phy_id),
description=description)
except Exception as e:
@ -99,7 +99,7 @@ def create(json):
vm_name = unidecode(vm_name_utf8)
image_name = 'vm-' + str(phy_id) + '-disk-1'
#try:
# local_storage = proxobject.nodes(real_slave_name).storage('vm')
# local_storage = proxobject.nodes(real_slave_name).storage('lvm')
# storage_create_result = local_storage.content.post(vmid=phy_id, filename=image_name, size=json['hdd'] + 'G')
# ioconfig.logger.info('%s[%s]> allocated %s as %s' % (json['clientemail'], slave_name, json['hdd'], image_name))
#except:
@ -121,7 +121,7 @@ def create(json):
net0='name=eth0,bridge=' + json['net0if'] + ',ip=' + json['net0ip'] + '/' + json['net0mask'],
net1='name=eth1,bridge=' + json['net1if'] + ',ip=' + json['net1ip'] + '/' + json['net1mask'] + ',gw=' + json['net1gw'],
ostemplate='backup:vztmpl/debian-9.0-standard_9.0-2_amd64.tar.gz',
rootfs='volume=vm:' + str(json['hdd']),
rootfs='volume=lvm:' + str(json['hdd']),
swap=32,
description=description)
except: