User Tools

Site Tools


xenvirtualmachines

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
xenvirtualmachines [2007/11/24 22:23]
127.0.0.1 external edit
xenvirtualmachines [2020/02/13 22:55] (current)
Line 1: Line 1:
  
 ====== Xen Virtual Machines ====== ====== Xen Virtual Machines ======
-<toc><ul><li><link topicref="2">Xen Server dom0</link></li><li><link topicref="3">Xen Client domU using debootstrap</link></li><li><link topicref="4">Xen Client domU using netboot</link></li></ul></toc>+
 ====== Xen Server dom0 ====== ====== Xen Server dom0 ======
 You should create a partition a bit larger than the amount of ram allocated to domU guests.  If you shutdown the dom0, the domU guests are saved state to '/var/lib/xen/save' You should create a partition a bit larger than the amount of ram allocated to domU guests.  If you shutdown the dom0, the domU guests are saved state to '/var/lib/xen/save'
  
 <code> <code>
-lvcreate --size 4.1g --name xen vg01+lvcreate --size 16.1g --name xen vg01
 mkdir /var/lib/xen mkdir /var/lib/xen
 </code> </code>
 +
 And add to /etc/fstab And add to /etc/fstab
  
Line 14: Line 15:
 /dev/mapper/vg01-xen /var/lib/xen            reiserfs noatime               2 /dev/mapper/vg01-xen /var/lib/xen            reiserfs noatime               2
 </code> </code>
 +
 and mount and mount
  
Line 19: Line 21:
 mount /var/lib/xen mount /var/lib/xen
 </code> </code>
-====== Xen Client domU using debootstrap ====== 
-Below 'vm01' is the hostname of my VirtualMachine.  The Xen host has 2 Raid 1 mirrors, so I want to stripe across them creating a Raid 10. 
  
-<code> +====== Xen Client domU using netboot ======
-lvcreate --size 1g -i 2 --name vm01-slash vg01 +
-lvcreate --size 2g -i 2 --name vm01-swap vg01 +
-lvcreate --size 2g -i 2 --name vm01-usr vg01 +
-lvcreate --size 2g -i 2 --name vm01-var vg01+
  
-mkfs.ext3 /dev/vg01/vm01-slash 
-mkswap /dev/vg01/vm01-swap 
-mkfs.reiserfs /dev/vg01/vm01-usr 
-mkfs.reiserfs /dev/vg01/vm01-var 
- 
-mount /dev/vg01/vm01-slash /mnt/ 
-mkdir /mnt/usr /mnt/var 
-mount /dev/vg01/vm01-usr /mnt/usr/ 
-mount /dev/vg01/vm01-var /mnt/var/ 
- 
-debootstrap --arch amd64 --include=reiserfsprogs,linux-image-2.6-xen-amd64,ssh lenny /mnt 
- 
-cd /mnt 
-cp /etc/hosts etc/ 
-sed -i 's/xen01/vm01/g' etc/hosts 
-echo vm01 &gt; etc/hostname 
-cp /etc/apt/sources.list /etc/apt/preferences etc/apt/ 
-</code> 
-<strong>etc/network/interfaces</strong>: 
- 
-<code> 
-# This file describes the network interfaces available on your system 
-# and how to activate them. For more information, see interfaces(5). 
- 
-# The loopback network interface 
-auto lo 
-iface lo inet loopback 
- 
-# The primary network interface 
-auto eth0 
-iface eth0 inet static 
-        address 1.2.3.4 
-        netmask 255.255.255.0 
-        gateway 1.2.3.1 
-</code> 
-<strong>etc/fstab</strong>: 
- 
-<code> 
-# /etc/fstab: static file system information. 
-# 
-# &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt; 
-proc            /proc           proc    defaults        0       0 
-/dev/sda1        /               ext3    defaults,errors=remount-ro 0       1 
-/dev/sda3 /usr            reiserfs defaults        0       2 
-/dev/sda4 /var            reiserfs noatime        0       2 
-/dev/sda2 none            swap    sw              0       0 
-/dev/hda        /media/cdrom0   udf,iso9660 user,noauto           0 
-</code> 
-<strong>boot/grub/menu.lst</strong>: 
- 
-<code> 
-title           Debian GNU/Linux, kernel 2.6.26-2-xen-amd64 
-root            (hd0,0) 
-kernel          /boot/vmlinuz-2.6.26-2-xen-amd64 root=/dev/sda1 xencons=tty ro 
-initrd          /boot/initrd.img-2.6.26-2-xen-amd64 
- 
-title           Debian GNU/Linux, kernel 2.6.26-2-xen-amd64 (single-user mode) 
-root            (hd0,0) 
-kernel          /boot/vmlinuz-2.6.26-2-xen-amd64 root=/dev/sda1 xencons=tty ro single 
-initrd          /boot/initrd.img-2.6.26-2-xen-amd64 
-</code> 
-<strong>/etc/xen/vm01.cfg</strong>: 
- 
-<code> 
-# Debian 5.0 
-memory = 1024 
-name = &quot;vm01&quot; 
-bootloader = &quot;/usr/lib/xen-3.2-1/bin/pygrub&quot; 
-disk = [ 'phy:vg01/vm01-slash,sda1,w', 'phy:vg01/vm01-swap,sda2,w', 'phy:vg01/vm01-usr,sda3,w', 'phy:vg01/vm01-var,sda4,w' ] 
-# Default bridged network interface 
-vif = [ 'bridge=xenbr0' ] 
-vcpus = 2 
-# Single-user mode 
-#extra = &quot;1&quot; 
-</code> 
-<code> 
-umount /mnt/usr /mnt/var /mnt 
-cd /etc/xen/auto 
-ln -s ../vm01.cfg . 
-xm create -c vm01.cfg 
-</code> 
-After boot you need to: 
- 
-<list><ol><li>Set a root password, create local user accounts</li><li><strong>dpkg-reconfigure tzdata</strong></li><li><strong>dpkg-reconfigure exim4-config</strong></li></ol></list> 
-====== Xen Client domU using netboot ====== 
 This creates the LV with equal-sized stripes over a 2 drive Volume Group (Creates a raid0 LV for write performance). This creates the LV with equal-sized stripes over a 2 drive Volume Group (Creates a raid0 LV for write performance).
  
Line 118: Line 29:
 # lvcreate --size 10g -i 2 --name ubuntu14 vg01 # lvcreate --size 10g -i 2 --name ubuntu14 vg01
   Using default stripesize 64.00 KiB   Using default stripesize 64.00 KiB
-  Logical volume &quot;ubuntu14&quot; created+  Logical volume 'ubuntu14created
 </code> </code>
 +
 <code> <code>
 mkdir /var/lib/xen/trusty-netboot mkdir /var/lib/xen/trusty-netboot
Line 126: Line 38:
 wget -c http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/xen/vmlinuz wget -c http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/xen/vmlinuz
 </code> </code>
-<strong>/etc/xen/ubuntu14.cfg</strong>:+ 
 +**/etc/xen/ubuntu14.cfg**:
  
 <code> <code>
-name = &quot;ubuntu14&quot;+name = 'ubuntu14'
  
-memory = 1024+memory = 4000
 vcpus = 4 vcpus = 4
  
Line 137: Line 50:
 vif = [ 'bridge=xenbr0' ] vif = [ 'bridge=xenbr0' ]
  
-kernel = &quot;/var/lib/xen/trusty-netboot/vmlinuz&quot; +kernel = '/var/lib/xen/trusty-netboot/vmlinuz' 
-ramdisk = &quot;/var/lib/xen/trusty-netboot/initrd.gz&quot; +ramdisk = '/var/lib/xen/trusty-netboot/initrd.gz' 
-extra = &quot;debian-installer/exit/always_halt=true -- console=hvc0 url=...&quot;+extra = 'debian-installer/exit/always_halt=true -- console=hvc0 url=server-with-preseed.com'
 </code> </code>
 Start the installer: Start the installer:
Line 150: Line 63:
 <code> <code>
 ... ...
-#kernel = &quot;/var/lib/xen/trusty-netboot/vmlinuz&quot; +#kernel = '/var/lib/xen/trusty-netboot/vmlinuz' 
-#ramdisk = &quot;/var/lib/xen/trusty-netboot/initrd.gz&quot; +#ramdisk = '/var/lib/xen/trusty-netboot/initrd.gz' 
-#extra = &quot;debian-installer/exit/always_halt=true -- console=hvc0 url=...&quot; +#extra = 'debian-installer/exit/always_halt=true -- console=hvc0 url=server-with-preseed.com' 
-bootloader = &quot;pygrub&quot;+bootloader = 'pygrub'
 </code> </code>
  
xenvirtualmachines.1195960993.txt.gz · Last modified: 2020/02/13 22:55 (external edit)

free spam filter