Mudanças entre a Versão 1 e Versão 2 de ParavirtualUbuntu


Ignorar:
Timestamp:
21/05/2015 15:30:28 (4 anos atrás)
Autor:
fabior
Comentário:

--

Legenda:

Não Modificado
Adicionado
Removido
Modificado
  • ParavirtualUbuntu

    v1 v2  
    55
    66'''We start with creating and installing a VM with HVM.'''
    7 
    87
    98 * Create a VM from the ''Other install media'' template
     
    1615'''We now create a new console and edit the boot settings.'''
    1716
    18 
    1917 * Connect to the VM using SSH
    2018 * Create a new console for Xen
    21 
    22 
    2319
    2420{{{
     
    2723
    2824}}}
    29 
    30 
    3125 * Replace all occurrences of ''tty1'' with ''hvc0''
    3226 * Read ''/boot/grub/grub.cfg''
    33 
    34 
    3527
    3628{{{
     
    3830
    3931}}}
    40 
    41 
    4232 * Copy the contents of ''menuentry'' near the bottom to a temporary text file, to be used as input for the ''makepv.sh ''script that we will use later on
    43 
    44 
    4533
    4634{{{
     
    5543
    5644}}}
    57 
    58 
    5945 * Make special note of ''/boot/vmlinuz''…, ''root=UUID=''… and ''/boot/initrd.img''…
    6046 * Shutdown the VM
     
    6248'''We now convert the VM to PV.'''
    6349
    64 
    6550 * Connect to the !XenServer host with SSH
    6651 * Copy the ''makepv.sh'' script ([http://www.jansipke.nl/res/xenserver/makepv.sh download from here]) to the !XenServer host and make it executable
    67 
    68 
    6952
    7053{{{
     
    7255
    7356}}}
    74 
    75 
    7657 * Run the ''makepv.sh'' script, replacing ''my-vm-name'' with the actual name of your VM
    77 
    78 
    7958
    8059{{{
     
    8261
    8362}}}
    84 
    8563'''Finally we install the !XenServer tools.'''
    86 
    8764
    8865 * Boot the VM and log in with SSH
    8966 * In !XenCenter, attach'' xs-tools.iso'' to the DVD drive of the VM
    9067 * Mount ''xs-tools.iso'', install the correct !XenServer Tools package (replace ''amd64'' with ''i386'' if necessary) and unmount ''xs-tools.iso''
    91 
    92 
    9368
    9469{{{
     
    9873
    9974}}}
    100 
    101 
    10275 * In !XenCenter, detach ''xs-tools.iso'' from the DVD drive of the VM (this ensures that !XenServer does not complain about too many bootable devices)
    10376 * Reboot the VM and log in with SSH
    10477 * Make sure the services run at boot time
    105 
    106 
    10778
    10879{{{
     
    11182
    11283}}}
    113 
    114 
    11584 * Reboot the VM for the last time
    11685 * Restart !XenCenter to be able to log in to the console of the VM
     86
     87'''Script makepv.sh''':
     88
     89{{{
     90#!/bin/bash
     91
     92confirm() {
     93    echo -n "$1"
     94    echo -n "OK [Y/n]?"
     95    read ANSWER
     96    if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ] || [ -z "$ANSWER" ]
     97    then
     98        eval $1
     99        echo "... parameter set"
     100    else
     101        echo "... parameter NOT set"
     102    fi
     103}
     104
     105if [ -z "$1" ]
     106then
     107    echo -n "Name of VM [l for list]: "
     108    read VM
     109else
     110    VM="$1"
     111fi
     112
     113if [ "$VM" == "l" ] || [ "$VM" == "L" ]
     114then
     115    xe vm-list | grep name-label | grep -v "Control domain"
     116    exit
     117fi
     118
     119echo ""
     120echo "Looking up UUID for VM $VM"
     121
     122UUID=$(xe vm-list name-label="$VM" params=uuid --minimal)
     123if [ -z $UUID ]
     124then
     125    echo "No UUID found for $VM."
     126    exit 0
     127fi
     128
     129echo ""
     130echo "UUID=$UUID"
     131echo ""
     132echo "Setting parameters for VM $VM"
     133confirm "xe vm-param-set uuid=$UUID HVM-boot-policy="
     134confirm "xe vm-param-set uuid=$UUID PV-bootloader=pygrub"
     135
     136echo ""
     137echo -n "Specify path to Kernel (e.g. /boot/vmlinuz...): "
     138read KERNEL_PATH
     139
     140echo ""
     141echo -n "Specify Kernel arguments (root=UUID=... ro quiet): "
     142read KERNEL_ARGS
     143
     144echo ""
     145echo -n "Specify path to ramdisk (e.g. /boot/initrd...): "
     146read RAMDISK_PATH
     147
     148echo ""
     149confirm "xe vm-param-set uuid=$UUID PV-bootloader-args=\"--kernel=$KERNEL_PATH --ramdisk=$RAMDISK_PATH\""
     150echo ""
     151confirm "xe vm-param-set uuid=$UUID PV-args=\"$KERNEL_ARGS console=hvc0 xencons=hvc0\""
     152
     153echo ""
     154echo "List of disks for VM $VM"
     155xe vm-disk-list uuid=$UUID
     156
     157echo ""
     158echo "Looking up UUID for VBD of VM $VM"
     159VBD=$(xe vm-disk-list uuid=$UUID | grep -A1 VBD | tail -n 1 | cut -f2 -d: | sed "s/ *//g")
     160if [ -z $VBD ]
     161then
     162    echo "No VBD UUID found for $VBD."
     163    exit 0
     164fi
     165
     166echo "VBD UUID=$VBD"
     167echo ""
     168echo "Setting parameters for VBD $VBD"
     169confirm "xe vbd-param-set uuid=$VBD bootable=true"
     170exit 0
     171}}}
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.