Skip to contentSkip to conversation

Docs: How to create and install CentOS PVMs with xe CLI on XCP 1.1

DISCUSSION M. Schneider 2 participants 3 messages Oct 25, 2011 – Nov 2, 2011

lore
Share & tools
lore
#0 lore raw

Hello,

First thank you very much for *XCP 1.1*, the *vmvnc* script and helpful hints from both xen-lists!

I hope the description below "How to create and install CentOS PVMs with xe CLI on XCP 1.1" will be helpful for first steps without XenCenter (as it doesn't run on Linux yet). Installation of PVM for ubuntu 11.10 server is very similar.

I strongly suggest to read documentation of XenServer 5.6 sp2 (reference.pdf and guest.pdf) for better understanding.

Enjoy and feel free to add it to xen-wiki or to documentation if you find it useful .

regards, Mark

Signature · 103 lines
[email protected]


*Installing of CentOS6 PVM (xe CLI / XCP 1.1)*

*# On the XCP 1.1 host*

# Prepare local iso repository
/var/opt/xen/iso_import/centos6
wget -Nc http://mirror.switch.ch/ftp/mirror/centos/6.0/isos/x86_64/CentOS-6.0-x86_64-minimal.iso
xe sr-create name-label=centos6 type=iso device-config:location=/var/opt/xen/iso_import/centos6 device-config:legacy_mode=true content-type=iso
xe cd-list

# Create and tune PVM
xe vm-install new-name-label=centos6dbrt20 sr-name-label=Local\ LVM\ SR\ DB-VM-pool  template=Other\ install\ media
xe vdi-create name-label="VDI centos6 dbrt20 server" sr-uuid=638d8bb3-4b08-f7c0-1e9d-2dc496b86c49 type=user sm-config:type=raw virtual-size=32GiB
xe vm-list

xe vm-param-set VCPUs-max=4 uuid=a4db5c10-a197-6200-fdca-60a9a231f261
xe vm-param-set VCPUs-at-startup=2 uuid=a4db5c10-a197-6200-fdca-60a9a231f261
xe vm-param-set memory-static-max=4GiB uuid=a4db5c10-a197-6200-fdca-60a9a231f261
xe vm-param-set memory-dynamic-max=4GiB uuid=a4db5c10-a197-6200-fdca-60a9a231f261
xe vm-param-set memory-dynamic-min=1GiB uuid=a4db5c10-a197-6200-fdca-60a9a231f261
xe vm-param-set memory-static-min=1GiB uuid=a4db5c10-a197-6200-fdca-60a9a231f261

xe vdi-create name-label="VDI centos6 dbrt20 server" sr-uuid=638d8bb3-4b08-f7c0-1e9d-2dc496b86c49 type=user sm-config:type=raw virtual-size=32GiB
xe vdi-list
xe vm-disk-add vm=centos6dbrt20 sr-uuid=638d8bb3-4b08-f7c0-1e9d-2dc496b86c49  device=0 disk-size=34359738368
xe vbd-list
xe vbd-param-set bootable=false uuid=878a2e9c-4efa-3daa-e5ad-5f98244d93c6

xe vm-list
xe network-list
xe vif-create vm-uuid=a4db5c10-a197-6200-fdca-60a9a231f261  network-uuid=9f6f2c37-090c-148a-1a99-134846808d10 mac=random device=0
xe vm-cd-add vm=centos6dbrt20 device=3 cd-name=CentOS-6.0-x86_64-minimal.iso
xe vm-cd-list vm=centos6dbrt20
xe vbd-param-set bootable=true uuid=c6ac1b61-fdf0-37c9-f6b5-aedcb74d8ba5
xe vm-param-set uuid=a4db5c10-a197-6200-fdca-60a9a231f261 other-config:install-repository=cdrom

# Start the installation of CentOS
xe vm-start vm=centos6dbrt20


*# On the linux client with vncviewer*
ironm@debian:~$ ./vmvnc -h 192.168.1.190 -g centos6dbrt20

# --- vmvnc script script
#!/bin/bash

function usage () {
    echo "Usage:"
    echo "   `basename $0` -h<xenserver host>   -g<guest vm name-label>"
    echo "   `basename $0` -h<xenserver host>   -u<guest vm uuid>"
    echo "   `basename $0` -h<xenserver host>   -d<domID>"
    exit 1
}

while getopts "h:g:u:d:" option
do
    case $option in
        h ) xs=${OPTARG} ;;
        g ) vm=${OPTARG} ;;
        u ) uu=${OPTARG} ;;
        d ) id=${OPTARG} ;;
        * ) usage
    esac
done

if [ -z ${xs} ]; then
    usage
fi

if [ -z ${uu} ]&&   [ -z ${vm} ]&&   [ -z ${id} ]; then
    usage
fi

if [ ! -z ${uu} ]; then
    domid=`ssh root@${xs} xe vm-list uuid=${uu} params=dom-id --minimal`
elif [ ! -z ${vm} ]; then
    domid=`ssh root@${xs} xe vm-list name-label=${vm} params=dom-id --minimal`
elif [ ! -z ${id} ]; then
    domid=${id}
fi

if [ -z ${domid} ]; then
    echo "Could not find guest ${vm}${uu} on host ${xs}."
    exit 1
elif [ ${domid} -lt 0 ]; then
    echo "Guest ${vm}${uu} has no dom-id. Is your vm running?"
    exit 1
fi

port=`ssh root@${xs} xenstore-read /local/domain/${domid}/console/vnc-port`

if [ -z ${port} ]; then
    echo "Couldn't read VNC port from xenstore. Is your vm running?"
    exit 1
fi

echo "Connecting to vnc port ${port} on host ${xs}..."

vncviewer -via root@${xs} localhost::${port}
# ---

#!/bin/bash

function usage () {
echo "Usage:"
echo " basename $0 -h <xenserver host> -g <guest vm name-label>"
echo " basename $0 -h <xenserver host> -u <guest vm uuid>"
echo " basename $0 -h <xenserver host> -d <domID>"
exit 1
}

while getopts "h:g:u:d:" option
do

    case $option in
        h ) xs=${OPTARG} ;;
        g ) vm=${OPTARG} ;;
        u ) uu=${OPTARG} ;;
        d ) id=${OPTARG} ;;
        * ) usage
    esac

done

if [ -z ${xs} ]; then
usage
fi

if [ -z ${uu} ] && [ -z ${vm} ] && [ -z ${id} ]; then
usage
fi

if [ ! -z ${uu} ]; then

    domid=`ssh root@${xs} xe vm-list uuid=${uu} params=dom-id --minimal`
elif [ ! -z ${vm} ]; then
    domid=`ssh root@${xs} xe vm-list name-label=${vm} params=dom-id --minimal`
elif [ ! -z ${id} ]; then
    domid=${id}

fi

if [ -z ${domid} ]; then

    echo "Could not find guest ${vm}${uu} on host ${xs}."
    exit 1
elif [ ${domid} -lt 0 ]; then
    echo "Guest ${vm}${uu} has no dom-id. Is your vm running?"
    exit 1

fi

port=ssh root@${xs} xenstore-read /local/domain/${domid}/console/vnc-port

if [ -z ${port} ]; then
echo "Couldn't read VNC port from xenstore. Is your vm running?" exit 1
fi

echo "Connecting to vnc port ${port} on host ${xs}..."

vncviewer -via root@${xs} localhost::${port}

[root@xcp11db02 ~]# xe vm-list
uuid ( RO) : 4133031a-e064-38e7-416d-72e1eb0a9118
name-label ( RW): ubuntu11dbrt20
power-state ( RO): running

uuid ( RO) : c6f33171-eaa6-eb54-aff2-172625b14c39
name-label ( RW): ubuntu11nfs20
power-state ( RO): running

uuid ( RO) : a4db5c10-a197-6200-fdca-60a9a231f261
name-label ( RW): centos6dbrt20
power-state ( RO): running

uuid ( RO) : 9e0726af-580b-45db-b2ae-07cbc810ccb2
name-label ( RW): Control domain on host: xcp11db02
power-state ( RO): running

uuid ( RO) : df72d730-519d-70d9-da18-acd778a6afd9
name-label ( RW): ubuntu11dbp20
power-state ( RO): running

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
In reply to M. Schneider

*SOLUTION:*
I have modified the logical volume, then its size Resize to finally create the "Local LVM SR DB-VM-pool."

*NEW PROBLEM:*
He has been a new problem, in the step of giving confirmation to write the changes to the partition where you are installing centos, vncviewer disconnects and I can not reconnect.

Are you sure that the version 6 of the centos6 can be virtualized in the XCP 1.1??

You have completed the installation?

--
View this message in context: http://xen.1045712.n5.nabble.com/Docs-How-to-create-and-install-CentOS-PVMs-with-xe-CLI-on-XCP-1-1-tp4937495p4958431.html
Sent from the Xen - Dev mailing list archive at Nabble.com.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel