- Timestamp:
- Mar 30, 2008, 4:28:10 AM (17 years ago)
- Location:
- trunk/packages/sipb-xen-www/code
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/controls.py
r265 r340 69 69 lvcreate(machine, disk) 70 70 71 def lvcopy(machine_orig_name, machine, rootpw): 72 """Copy a golden image onto a machine's disk""" 73 remctl('web', 'lvcopy', machine_orig_name, machine.name, rootpw) 74 71 75 def bootMachine(machine, cdtype): 72 76 """Boot a machine with a given boot CD. … … 96 100 remctl('web', 'unregister', machine.name) 97 101 98 def createVm(owner, contact, name, memory, disk_size, is_hvm, cdrom ):102 def createVm(owner, contact, name, memory, disk_size, is_hvm, cdrom, clone_from): 99 103 """Create a VM and put it in the database""" 100 104 # put stuff in the table … … 137 141 registerMachine(machine) 138 142 makeDisks(machine) 143 if clone_from: 144 lvcopy(clone_from, machine, 'password') 139 145 # tell it to boot with cdrom 140 146 bootMachine(machine, cdrom) -
trunk/packages/sipb-xen-www/code/main.py
r309 r340 160 160 if cdrom is not None and not CDROM.get(cdrom): 161 161 raise CodeError("Invalid cdrom type '%s'" % cdrom) 162 163 clone_from = fields.getfirst('clone_from') 164 if clone_from and clone_from != 'ice3': 165 raise CodeError("Invalid clone image '%s'" % clone_from) 166 162 167 return dict(contact=user, name=name, memory=memory, disk_size=disk_size, 163 owner=owner, is_hvm=is_hvm, cdrom=cdrom )168 owner=owner, is_hvm=is_hvm, cdrom=cdrom, clone_from=clone_from) 164 169 165 170 def create(user, fields): -
trunk/packages/sipb-xen-www/code/templates/list.tmpl
r280 r340 50 50 <td>Boot CD</td> 51 51 <td>$cdromList($cdroms, $defaults.cdrom)</td> 52 </tr> 53 $errorRow('cdrom', $err) 54 <tr> 55 <td>Clone image?</td> 56 <td><input type="checkbox" name="clone_from" value="ice3"/> 57 (experimental; 1-2 minutes, and you have an etch machine; root pw is 'password'.)</td> 52 58 </tr> 53 59 $errorRow('cdrom', $err)
Note: See TracChangeset
for help on using the changeset viewer.