X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/661bd540a962da6e82c2d2c6b55dcbdf592718db..b330d95bd2b2f5fe7724d470856e58ebe75df1ab:/code/controls.py diff --git a/code/controls.py b/code/controls.py index 0661927..0889d4c 100644 --- a/code/controls.py +++ b/code/controls.py @@ -112,7 +112,7 @@ def createVm(username, state, owner, contact, name, description, memory, disksiz machine.type = machine_type session.add(machine) disk = Disk(machine=machine, - guest_device_name='xvda', size=disksize) + guest_device_name='hda', size=disksize) nic = NIC.query.filter_by(machine_id=None).filter_by(reusable=True).first() if not nic: #No IPs left! raise CodeError("No IP addresses left! " @@ -223,6 +223,7 @@ def deleteVM(machine): def commandResult(username, state, command_name, machine_id, fields): start_time = 0 + result = None machine = validation.Validate(username, state, machine_id=machine_id).machine action = command_name cdrom = fields.get('cdrom') or None @@ -274,10 +275,14 @@ def commandResult(username, state, command_name, machine_id, fields): raise CodeError('ERROR on remctl') elif action == 'delete': deleteVM(machine) + elif action == 'renumber': + result = remctl('control', machine.name, 'renumber') d = dict(user=username, command=action, machine=machine) + if result: + d['result'] = result return d def resizeDisk(machine_name, disk_name, new_size):