This commit is contained in:
deflax 2016-07-30 14:42:02 +03:00
parent 8bba4a75b2
commit 60401254cd
3 changed files with 2 additions and 8 deletions

View file

@ -29,8 +29,7 @@ def addclient(vmid, vmname, clientid, clientname, clientemail, vmpass):
newclient = { str(clientid):vcard }
clientsdb.update(newclient)
#Send initial email to the user as we will use the internal auth from now on.
###utils.sendmail(clientemail, '{} logged in.'.format)
#TODO: Sync with proxmaster-admin database (shell command could be used for this one)
#utils.sendmail(clientemail, '{} logged in.'.format)
ioconfig.logger.info('client[{}]> vmid {} is now owned by {} ({})'.format(clientid, vmid, clientemail, clientname))
#create initial vm template

View file

@ -217,7 +217,7 @@ def generate_ipv4(region_id, how_many=1):
ip_max = len(region_ips) - 1
tested_ips = [] #initialize ip cache
requested_ips = []
all_ips = utils.find_rec(grid_data, 'ipaddr')
all_ips = utils.find_rec(grid_data, 'ipaddr') #TODO: we cant list that for KVM so we should use another approach. perhaps as separate macaddress - ipaddress table which we will use to manipulate a static lease dhcp server. at this point this function is useless because plugins do not or cant track the address of the actual machine. proxmaster should divide each region to segments and each segment should export a static lease config which will be quieried when we search for unused addresses.
for ips in range(int(how_many)):
counter = 0

View file

@ -85,7 +85,6 @@ def vmcreate(req):
response = { 'status':'CREATE', 'vmid':vm_id, 'name':vm_name, 'password':vm_pass, 'ipv4_0':vm_ipv4[0] }
disk_filename = 'vm-' + vm_id + '-disk-1'
description = vm_name + ' (' + vm_id + ')\n'
description += 'owned by ' + client_name + ' (' + client_id + ')\n'
description += 'master ip: ' + vm_ipv4[0]
@ -158,7 +157,6 @@ def vmstart(vm_id):
result = proxobject.nodes(slave_name).qemu(vm_id).status.start.post()
if vm_type == 'lxc':
result = proxobject.nodes(slave_name).lxc(vm_id).status.start.post()
#ioconfig.logger.info('slave[{}]> {}'.format(slave_name, result))
response = { 'status':'START' }
return response
@ -209,7 +207,6 @@ def vmsuspend(vm_id):
result = proxobject.nodes(slave_name).qemu(vm_id).status.suspend.post()
if vm_type == 'lxc':
result = proxobject.nodes(slave_name).lxc(vm_id).status.suspend.post()
#ioconfig.logger.info('slave[{}]> {}'.format(slave_name, result))
response = { 'status':'SUSPEND', 'vmid':vm_id }
return response
@ -226,7 +223,6 @@ def vmresume(vm_id):
result = proxobject.nodes(slave_name).qemu(vm_id).status.resume.post()
if vm_type == 'lxc':
result = proxobject.nodes(slave_name).lxc(vm_id).status.resume.post()
#ioconfig.logger.info('slave[{}]> {}'.format(slave_name, result))
response = { 'status':'RESUME', 'vmid':vm_id }
return response
@ -312,5 +308,4 @@ if __name__ == '__main__':
#internal module tests
time.sleep(1)
vmvnc(656758)
#vmstart(656758)