-
-
Save lucafavatella/61a9c08cc2ee5a2e81f9 to your computer and use it in GitHub Desktop.
Revisions
-
Ziptrek Administrator revised this gist
Apr 9, 2013 . 1 changed file with 16 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,11 +9,12 @@ VG=/dev/domU # existing volume group in which to create a logical volume LV=$NAME # name of the new logical volume to create LV_SIZE=5G # size of the new logical volume MEM_SIZE=512 # memory to allocate to this VM RELEASE=precise # "precise" (12.04LTS) or "quantal" (12.10) # Ubuntu distro settings. Change mirror or version as required. IMAGEDIR=/var/lib/xen/images/ubuntu-netboot MIRROR=http://ubuntu.arcticnetwork.ca/ DISTRO=/ubuntu/dists/$RELEASE/main/installer-amd64/current/images/netboot/xen #Create Disk lvcreate -L $LV_SIZE -n $LV $VG @@ -26,12 +27,16 @@ if [ ! -d "$IMAGEDIR" ]; then wget $MIRROR/$DISTRO/vmlinuz fi #Create pre-install Xen Config CONFIG=/etc/xen/$NAME.cfg if [ -f "$CONFIG" ]; then mv $CONFIG $CONFIG.old fi # on_reboot="destroy" is used in the initial config because we need to modify # the Xen config file before restarting when the install is complete. cat >> $CONFIG << EOL name="$NAME" memory=$MEM_SIZE @@ -40,13 +45,19 @@ vif=['bridge=xenbr0'] vfb=['vnc=1'] kernel="$IMAGEDIR/vmlinuz" ramdisk="$IMAGEDIR/initrd.gz" on_reboot="destroy" extra="console=hvc0" EOL #Launch the VM and connect to console to complete Ubuntu installation. xm create /etc/xen/$NAME.cfg -c #Modify the post-install Xen Config sed -i '/kernel/d' $CONFIG sed -i '/ramdisk/d' $CONFIG sed -i '/on_reboot/d' $CONFIG echo "bootloader=\"pygrub\"" >> $CONFIG #Launch the new VM xm create /etc/xen/$NAME.cfg -c -
abythell revised this gist
Mar 28, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ #!/bin/bash # Script to download, configure, and install Ubuntu as a Xen domU # Uses existing LVM Volume Group. Must be run as root/sudo. # Based on instructions at https://help.ubuntu.com/community/Xen # User Configurable Settings NAME=ubuntu # name of Domain to create -
abythell revised this gist
Mar 28, 2013 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ # Uses existing LVM Volume Group. Must be run as root/sudo. # User Configurable Settings NAME=ubuntu # name of Domain to create VG=/dev/domU # existing volume group in which to create a logical volume LV=$NAME # name of the new logical volume to create LV_SIZE=5G # size of the new logical volume @@ -41,9 +41,8 @@ kernel="$IMAGEDIR/vmlinuz" ramdisk="$IMAGEDIR/initrd.gz" EOL #Launch the VM and connect to console to complete Ubuntu installation xm create /etc/xen/$NAME.cfg -c #Modify Xen Config to use the kernel configured during the installation sed -i '/kernel/d' $CONFIG -
abythell created this gist
Mar 28, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ #!/bin/bash # Script to download, configure, and install Ubuntu as a Xen domU # Uses existing LVM Volume Group. Must be run as root/sudo. # User Configurable Settings NAME=amanda # name of Domain to create VG=/dev/domU # existing volume group in which to create a logical volume LV=$NAME # name of the new logical volume to create LV_SIZE=5G # size of the new logical volume MEM_SIZE=512 # memory to allocate to this VM # Ubuntu distro settings. Change mirror or version as required. IMAGEDIR=/var/lib/xen/images/ubuntu-netboot MIRROR=http://ubuntu.arcticnetwork.ca/ DISTRO=/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/xen #Create Disk lvcreate -L $LV_SIZE -n $LV $VG #Get Ubuntu Netboot kernel and ramdisk if [ ! -d "$IMAGEDIR" ]; then mkdir -p $IMAGEDIR cd $IMAGEDIR wget $MIRROR/$DISTRO/initrd.gz wget $MIRROR/$DISTRO/vmlinuz fi #Create Xen Config CONFIG=/etc/xen/$NAME.cfg if [ -f "$CONFIG" ]; then mv $CONFIG $CONFIG.old fi cat >> $CONFIG << EOL name="$NAME" memory=$MEM_SIZE disk=['phy:$VG/$LV,xvda,w'] vif=['bridge=xenbr0'] vfb=['vnc=1'] kernel="$IMAGEDIR/vmlinuz" ramdisk="$IMAGEDIR/initrd.gz" EOL #Launch the VM and connect to console xm create /etc/xen/$NAME.cfg -c exit 0 #Modify Xen Config to use the kernel configured during the installation sed -i '/kernel/d' $CONFIG sed -i '/ramdisk/d' $CONFIG sed -i '/extra/d' $CONFIG echo "bootloader=\"pygrub\"" >> $CONFIG