fixing vmcreate

This commit is contained in:
deflax 2016-11-03 16:07:28 +02:00
parent 87faee1287
commit 4c15e8ef84

View file

@ -74,7 +74,7 @@ def vmcreate(req):
#slave_name = str(grid.query_happiness(region_id, weight)) #TODO: provide weight parameters here and calculate route #slave_name = str(grid.query_happiness(region_id, weight)) #TODO: provide weight parameters here and calculate route
slave_name = 'lexx' #staic route slave_name = 'lexx' #staic route
#vmid = str(grid.generate_vmid()) #TODO: this should be between 100 and 65000 #vmid = str(grid.generate_vmid()) #TODO: this should be between 100 and 65000
vm_id = random.randint(200, 10200) vm_id = random.randint(1000, 9999)
cubeid = int(time.time() * 10000 * 10000) cubeid = int(time.time() * 10000 * 10000)
ipv4_list = grid.generate_ipv4(req['region'], req['vps_ipv4']) ipv4_list = grid.generate_ipv4(req['region'], req['vps_ipv4'])
@ -122,7 +122,7 @@ def vmcreate(req):
memory=req['vps_mem'], memory=req['vps_mem'],
virtio0='lvm:' + image_name, virtio0='lvm:' + image_name,
ide1='skyblue:iso/' + req['vps_os'] + ',media=cdrom', ide1='skyblue:iso/' + req['vps_os'] + ',media=cdrom',
net0='e1000,bridge=pub', net0='e1000,bridge=vmbr0',
onboot=1, onboot=1,
description=description) description=description)
@ -238,7 +238,7 @@ def vmrrd(cubeid):
""" retrieve rrd graphs (PNG) """ """ retrieve rrd graphs (PNG) """
slave_name, vm_type, vm_id = grid.query_vm(cubeid) slave_name, vm_type, vm_id = grid.query_vm(cubeid)
proxobject = auth(slave_name) proxobject = auth(slave_name)
object.c:luster.status.get()[0]['name'] object.cluster.status.get()[0]['name']
ioconfig.logger.info('slave[%s]> query rrd of %s %s' % (slave_name, vm_type, vm_id)) ioconfig.logger.info('slave[%s]> query rrd of %s %s' % (slave_name, vm_type, vm_id))
result = {} result = {}