Legend:
- Unmodified
- Added
- Removed
-
trunk/web/controls.py
r236 r243 88 88 remctl('web', 'unregister', machine.name) 89 89 90 def createVm(owner, contact, name, memory, disk , is_hvm, cdrom):90 def createVm(owner, contact, name, memory, disk_size, is_hvm, cdrom): 91 91 """Create a VM and put it in the database""" 92 92 # put stuff in the table … … 94 94 try: 95 95 validation.validMemory(owner, memory) 96 validation.validDisk(owner, disk * 1. / 1024)96 validation.validDisk(owner, disk_size * 1. / 1024) 97 97 validation.validAddVm(owner) 98 98 res = meta.engine.execute('select nextval(' … … 111 111 machine.type_id = machine_type.type_id 112 112 ctx.current.save(machine) 113 disk = Disk(machine .machine_id,114 'hda', disk)113 disk = Disk(machine_id=machine.machine_id, 114 guest_device_name='hda', size=disk_size) 115 115 open_nics = NIC.select_by(machine_id=None) 116 116 if not open_nics: #No IPs left! -
trunk/web/main.py
r236 r243 150 150 memory = validation.validMemory(user, memory, on=True) 151 151 152 disk = fields.getfirst('disk')153 disk = validation.validDisk(user, disk)152 disk_size = fields.getfirst('disk') 153 disk_size = validation.validDisk(user, disk_size) 154 154 155 155 vm_type = fields.getfirst('vmtype') … … 161 161 if cdrom is not None and not CDROM.get(cdrom): 162 162 raise CodeError("Invalid cdrom type '%s'" % cdrom) 163 return dict(contact=user, name=name, memory=memory, disk =disk,163 return dict(contact=user, name=name, memory=memory, disk_size=disk_size, 164 164 owner=owner, is_hvm=is_hvm, cdrom=cdrom) 165 165 -
trunk/web/xen-ips
r113 r243 38 38 39 39 def addip(ip): 40 n = NIC( None, randomMAC(), ip,None)40 n = NIC(machine_id=None, mac_addr=randomMAC(), ip=ip, hostname=None) 41 41 ctx.current.save(n) 42 42 ctx.current.flush()
Note: See TracChangeset
for help on using the changeset viewer.