Changeset 762 for trunk/packages/sipb-xen-database
- Timestamp:
- Jul 28, 2008, 3:25:33 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-database/client/etc/xen/sipb-database
r671 r762 19 19 machine = models.Machine.get_by(name=machine_name) 20 20 check(machine is not None) 21 hvm = machine.type.hvm 22 if 'cdrom_image' in locals(): 23 hvm = True 21 machine_type = models.Type.get_by(type_id=machine.type_id) 24 22 25 23 memory = machine.memory … … 35 33 viftype = "" 36 34 37 if hvm: 35 pae = machine_type.pae 36 acpi = machine_type.acpi 37 apic = machine_type.apic 38 39 vif = [] 40 41 disk = [] 42 43 if machine_type.hvm: 44 codepath = 'hvm' 45 else: 46 codepath = 'paravm' 47 48 if 'mirror' in locals(): #Installer 49 disk.append('phy:/dev/xenvg/d_foobar4_hda,hdb,r') 50 51 kernel = '/boot/vmlinuz-2.6.24-19-xen' #From hardy 52 ramdisk = '/boot/initrd.img-2.6.24-19-xen' 53 54 if not machine.nics: 55 raise RuntimeError('You must have a nic to autoinstall') 56 n = machine.nics[0] 57 extra = 'ro noresume' 58 extra += ' ip=%s::18.181.0.1:255.255.0.0:%s:eth0:off' % (n.ip, machine.name) 59 extra += ' mirror=%s dist=%s' % (mirror, dist) 60 extra += ' imagesize=%s' % imagesize 61 #extra += ' noinstall' 62 root = '/dev/hdb1' 63 codepath = None 64 elif 'cdrom_image' in locals(): 65 check(re.match('^[A-Za-z0-9][A-Za-z0-9_.-]*$', cdrom_image)) 66 disk.append('file:/srv/images/' + cdrom_image + '.iso,hdc:cdrom,r') 67 boot = 'd' 68 codepath = 'hvm' 69 70 if codepath == 'hvm': 38 71 ioemu = "ioemu:" 39 72 viftype = "type=ioemu, " 40 41 73 kernel = 'hvmloader' 42 74 builder = 'hvm' … … 44 76 vncpasswd = 'moocow' 45 77 device_model = '/usr/sbin/qemu-dm-sipb' 46 serial = 'pty' 47 else: 48 kernel = '/boot/vmlinuz-2.6.18-5-xen-amd64' 49 ramdisk = '/boot/initrd.img-2.6.18-5-xen-amd64' 50 builder = 'linux' 78 serial = "pty" 79 elif codepath == 'paravm': 80 bootloader = '/usr/lib/xen-default/bin/pygrub' 51 81 52 pae = machine.type.pae53 acpi = machine.type.acpi54 apic = machine.type.apic55 56 vif = []57 82 58 83 for n in machine.nics: … … 61 86 vif.append(d) 62 87 63 disk = []64 65 88 for d in machine.disks: 66 89 check(re.match('^[A-Za-z0-9]+$', d.guest_device_name)) … … 68 91 dspec = 'phy:%s,%s%s,w' % (device, diskioemu, d.guest_device_name) 69 92 disk.append(dspec) 70 71 if 'installer' in locals():72 check(re.match('^[A-Za-z0-9][A-Za-z0-9_.-]*$', installer))73 tmptree = tempfile.mkdtemp('', 'auto-install.', '/tmp')74 call(['/usr/sbin/sipb-xen-make-iso', installer, tmptree]75 + installer_options.split(' '))76 disk.append('file:'+tmptree+'/install.iso,hdc:cdrom,r')77 boot = 'd'78 79 elif 'disks' in locals(): # for the copying installer's use80 disk = disks.split(' ')81 boot = 'c'82 83 elif 'cdrom_image' in locals():84 check(re.match('^[A-Za-z0-9][A-Za-z0-9_.-]*$', cdrom_image))85 disk.append('file:/srv/images/' + cdrom_image + '.iso,hdc:cdrom,r')86 boot = 'd'87 93 88 94 usbdevice = 'tablet'
Note: See TracChangeset
for help on using the changeset viewer.