Virsh building Fedora 12 & CentOS 5.4 PV Guests at xVM 3.4.2 (b130)

Setup bellow might seem strange unless you will become aware of some ongoing issues with VNC-Console behavior during virt-install running on the most recent OSOL builds 130 and 129. View [1],[2] at xen-discuss forum@opensolaris.org. Actually , it clearly demonstrates that Xen Guest might be created and managed via virsh in graphical mode , regardless of VNC issues ( at Dom0) affecting virt-install for particular OpenSolaris (b130,129) xVM 3.4.2 implementation. Virt-install in nographics mode would bring us to absolutely same results , but virsh scripting in this case would be silently skipped. Create virsh installation profile for F12 DomU , previously downloaded vmlinuz and and initrd.img from local Apache Mirror to current directory :-

root@Opensolaris130:/home/boris/fedora# cat f12.virsh-install
<domain type='xen'>
<name>VM12S</name>
<os>
<type>linux</type>
<kernel>/export/home/boris/fedora/vmlinuz</kernel>
<initrd>/export/home/boris/fedora/initrd.img</initrd>
</os>
<memory>1048576</memory>
<vcpu>1</vcpu>
<devices>
<disk type='block' device='disk'>
<driver name='phy' type='zvol'/>
<source dev='/tank2/guest-pv'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge='rge0'/>
<mac address='00:16:36:43:2a:72'/>
</interface>
<input type='mouse' bus='xen'/>
</devices>
</domain>

Start install
# virsh create f12.virsh-install
# virsh console VM12S





Now F12 DomU will bring up vncserver to perform graphical install due to Dom0 doesn’t
have one properly initialized. VNC Console cannot be brought up via virt-install as it supposed to happen.





Notice, that

virt-install --paravirt --name VF12S --ram 1024 --nographics --os-type=linux --os-variant=fedora11 --network bridge -f /dev/zvol/dsk/tank3/guest-pv -l http://192.168.1.33/f12 --debug

will also suggest to bring up VNCSERVER at DomU during install and will finally create create same F12 domain without VFB specifified.

When done. Shutdown domain
Runtime profile :-

root@Opensolaris130:/home/boris/fedora# cat f12.virsh-run
<domain type='xen'>
<name>VM12S</name>
<currentMemory>1048576</currentMemory>
<memory>1048576</memory>
<bootloader>/usr/lib/xen/bin/pygrub</bootloader>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<distro>
<type>linux</type>
<variant>fedora11</variant>
</distro>
<vcpu>1</vcpu>
<devices>
<disk type='block' device='disk'>
<source dev='/dev/zvol/dsk/tank2/guest-pv'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge=''/>
<mac address='00:16:36:63:f0:87'/>
</interface>
<input type='mouse' bus='xen'/>
</devices>
</domain>

Load Domain :-
# virsh define f12.virsh-run
# virsh start VM12S
# virsh console VM12S

root@Opensolaris130:/home/boris/fedora# virsh list
Id Name State
----------------------------------
0 Domain-0 running
- F12PV shut off
- VM12S shut off
root@Opensolaris130:/home/boris/fedora# virsh start VM12S
Domain VM12S started
root@Opensolaris130:/home/boris/fedora# virsh console VM12S
PCI: Fatal: No config space access function found
Welcome to Fedora
Press 'I' to enter interactive startup.
Starting udev: [ OK ]
Setting hostname fedora: [ OK ]
Setting up Logical Volume Management: 2 logical volume(s) in volume group "vg_fedora" now active
[ OK ]
Checking filesystems
Checking all file systems.
[/sbin/fsck.ext4 (1) -- /] fsck.ext4 -a /dev/mapper/vg_fedora-lv_root
/dev/mapper/vg_fedora-lv_root: clean, 169695/1291808 files, 1096535/5165056 blocks
[/sbin/fsck.ext4 (1) -- /boot] fsck.ext4 -a /dev/xvda1
Remounting root filesystem in read-write mode: [ OK ]
Mounting local filesystems: [ OK ]
Enabling local filesystem quotas: [ OK ]
Enabling /etc/fstab swaps: [ OK ]
Entering non-interactive startup
Applying Intel CPU microcode update: [ OK ]
Starting monitoring for VG vg_fedora: 2 logical volume(s) in volume group "vg_fedora" monitored
[ OK ]
Starting portreserve: [ OK ]
Starting system logger: [ OK ]
Starting irqbalance: [ OK ]
Starting rpcbind: [ OK ]
Starting system message bus: ^G^G[ OK ]
Starting Avahi daemon... [ OK ]
Starting cups: [ OK ]
Starting HAL daemon: [ OK ]
Starting PC/SC smart card daemon (pcscd): [ OK ]
Retrigger failed udev events[ OK ]
Setting network parameters... [ OK ]
Starting NetworkManager daemon: [ OK ]
Starting NFS statd: [ OK ]
Starting RPC idmapd: [ OK ]
Enabling Bluetooth devices:
Starting sshd: [ OK ]
Starting abrt daemon: [ OK ]
Starting console mouse services: [ OK ]
Starting httpd: [ OK ]
[ OK ] crond: [ OK ]
[ OK ] atd: [ OK ]
New 'fedora:1 ()' desktop is fedora:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/fedora:1.log
Fedora release 12 (Constantine)
Kernel 2.6.31.5-127.fc12.x86_64 on an x86_64 (/dev/hvc0)
fedora login: root
Password:
Last login: Sun Dec 27 17:14:50 on hvc0
[root@fedora ~]#








Now domU automatically starts vncserver with ~.vnc/xstartup , including line:-

/usr/bin/gnome-session &

instead of “xterm &”.
At this point switching to Dom0 VFB appears to be possible. Create new virsh profile f12vfb.virsh-run :-

<domain type='xen'>
<name>VM12FB</name>
<currentMemory>1048576</currentMemory>
<memory>1048576</memory>
<bootloader>/usr/lib/xen/bin/pygrub</bootloader>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<distro>
<type>linux</type>
<variant>fedora11</variant>
</distro>
<vcpu>1</vcpu>
<devices>
<disk type='block' device='disk'>
<source dev='/dev/zvol/dsk/tank2/guest-pv'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge=''/>
<mac address='00:16:36:63:f0:87'/>
</interface>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' keymap='en-us'/>
</devices>
</domain>

# virsh define f12vfb.virsh-run
# virsh start VM12FB
# vncviewer localhost:0
Logged in and add non root user , then switch initidefault to 5 in /etc/inittab .
Shutdown domain and start it again:-



Virt-install CentOS 5.4 as follows:-

virt-install --paravirt --name RH54S \
--ram 1024 --nographics \
--network bridge -f /dev/zvol/dsk/tank3/guest-pv \
-l http://192.168.1.33/rhel --debug






Made same changes to DomU and remove “console=xvc0″ from kernel line of corresponding entry of
/boot/grub/menu.lst
Add line :

<graphics type='vnc' port='-1' keymap='en-us'/>

to rhel54-vfb.xml and change domain name say to RH54FB.

<domain type='xen'>
<name>RH54FB</name>
<currentMemory>1048576</currentMemory>
<memory>1048576</memory>
<bootloader>/usr/lib/xen/bin/pygrub</bootloader>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<distro>
<type>linux</type>
<variant>rhel5</variant>
</distro>
<vcpu>1</vcpu>
<devices>
<disk type='block' device='disk'>
<source dev='/dev/zvol/dsk/tank3/guest-pv'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<source bridge=''/>
<mac address='00:16:36:63:f0:87'/>
</interface>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' keymap='en-us'/>
</devices>
</domain>


# virsh define rhel54-vfb.xml
# virsh start RH54FB
# vncviewer localhost:0




References
1.http://opensolaris.org/jive/thread.jspa?threadID=120192&tstart=0
2.http://opensolaris.org/jive/thread.jspa?threadID=120092&tstart=0

About these ads

One Response to Virsh building Fedora 12 & CentOS 5.4 PV Guests at xVM 3.4.2 (b130)

  1. Stuart Regas says:

    I genuinely enjoy this blog.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: