Wednesday, June 6, 2012

Chapter 2 - Virtual Machines and Automated Installations

   Here we go with KVM , yaay !! RHEL6's replacement for xen. Did anybody ever use xen anyway ? Never-the-less....here we go ...

Well actually not true...I forgot to install the GNOME Desktop on my server1 that I built for KVM ...so tried and tried to re-install packages from the CD again by choosing the selection "Install OR Upgrade an existing system...

First modify VM to go into BIOS on boot



Tab over to the 'Boot' menu :


Now change boot device order back to CD-ROM being top in the list, to start up the installer from the ISO image again :


Back to the installer



Ok, and for the record, I tried every option I could think of , thinking that eventually I was goning to see the 'Package Selection' screen again, but not ? (If you figure this out, please email me !! ...thnx !) Gave up on this, and just used the command line and a yum group install to get the proper packages for GNOME Desktop :


[root@server1 ~]# yum groupinstall "X Window System" "GNOME Desktop Environment"
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
Setting up Group Process
localRepo/group_gz                                       | 196 kB     00:00 ...
Package hal-0.5.14-11.el6.x86_64 already installed and latest version
Warning: Group GNOME Desktop Environment does not exist.
Resolving Dependencies
--> Running transaction check


It still didn't start on boot (even 'startx' fails) so, in the interest of time, I am rebuilding the server, b'coz , I just read that /var needs alot of space, but unfortunately on this box, I set up my /var partition to be a 2 GB ext4 slice....doh !

Delete, Rebuild, Repeat.

Ok, so for the installer part, figured out that leving the default. but selecting the "review partitions" button will use the default partition layout, and let me modify, add, or delete what I want :)



Now there is about 51 GB in the / filesystem, which is where /var lives by default, so I am good with that :)



Ok this is a lot better now ...server01 with a 60 GB disk, read to roll



--------kvm stuff----------
[root@server01 ~]# lsmod | grep kvm
[root@server01 ~]# cat /proc/cpuinfo | egrep -i 'svm|vmx'
[root@server01 ~]# modprobe kvm
[root@server01 ~]#
[root@server01 ~]# lsmod | grep kvm
kvm                   300283  0
[root@server01 ~]# cat /proc/cpuinfo | egrep -i 'svm|vmx'
[root@server01 ~]#

 

Configure a VM from the GUI Desktop now :



Ok, we are having problems creating a VM, so we have to check if the required 7 modules are installed on this machine ...hmmm...did I set up my yum repo yet ?? Darm !


[root@server01 yum.repos.d]# rpm -qa |egrep 'kvm|qemu'
gpxe-roms-qemu-0.9.7-6.7.el6.noarch
qemu-img-0.12.1.2-2.160.el6.x86_64
qemu-kvm-0.12.1.2-2.160.el6.x86_64
[root@server01 yum.repos.d]#


I see we only got 3, so that would explain that :)

Soo......

Well since I had tcp/ip configured correctly, twas pulling from the ftp redhat site, but don't think everything I need is there ?

[root@server01 yum.repos.d]# df -ha
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_server01-lv_root
                       50G  2.4G   45G   6% /
proc                     0     0     0   -  /proc
sysfs                    0     0     0   -  /sys
devpts                   0     0     0   -  /dev/pts
tmpfs                1004M  260K 1004M   1% /dev/shm
/dev/sda1             485M   32M  429M   7% /boot
/dev/mapper/vg_server01-lv_home
                      5.5G  140M  5.1G   3% /home
none                     0     0     0   -  /proc/sys/fs/binfmt_misc
sunrpc                   0     0     0   -  /var/lib/nfs/rpc_pipefs
gvfs-fuse-daemon         0     0     0   -  /root/.gvfs
/dev/sr0              3.4G  3.4G     0 100% /media/RHEL_6.1 x86_64 Disc 1
[root@server01 yum.repos.d]#
[root@server01 yum.repos.d]#
[root@server01 yum.repos.d]#
[root@server01 yum.repos.d]# cp -ar /media/RHEL_6.1\ x86_64\ Disc\ 1/. /var/www/html/inst/

yum install python-virtinst virt-manager virt-top virt-viewer libvirt libvirt-client -y

[root@server01 ~]# rpm -qa | egrep -i 'kvm|virt'
virt-top-1.0.4-3.8.el6.x86_64
libvirt-client-0.8.7-18.el6.x86_64
libvirt-0.8.7-18.el6.x86_64
python-virtinst-0.500.5-3.el6.noarch
virt-viewer-0.2.1-3.el6.x86_64
qemu-kvm-0.12.1.2-2.160.el6.x86_64
virt-what-1.3-4.4.el6.x86_64
virt-manager-0.8.6-4.el6.noarch
libvirt-python-0.8.7-18.el6.x86_64
[root@server01 ~]#

and again ...

[root@server01 ~]# lsmod | grep kvm
[root@server01 ~]# modprobe kvm
[root@server01 ~]# lsmod | grep kvm
kvm                   300283  0
[root@server01 ~]#

Still not working to let me create any VM's , so I sent to the Desktop and tried to install Virtualization (even though all of my packages are already there ?)




Hmmmm, getting a network error ? thought this would check my local repos first ?

HAd to check software source first


Also, had to umount and re-mount the dvd/cd-rom drive iso image, now works....

But I think I know what the problem is, got to go into the BIOS of the VM and check for "Virtualization" setting like I did for chapter 1 ...doh !

Well after poking around a bit with the BIOS of the VM server01, and googling, it seems one cannot configure KVM to work on a RHEL6 instance running on Vmware Server :

http://www.linuxquestions.org/questions/linux-newbie-8/facing-problems-installing-kvm-on-rhel6-931208/

The virt-install command confirms this suspicion :

[root@server01 ~]# virt-install
ERROR    Host does not support any virtualization options
[root@server01 ~]#

try some of the other virt-* commands at the cli :


[root@server01 ~]# virsh
Welcome to virsh, the virtualization interactive terminal.
Type:  'help' for help with commands
       'quit' to quit
virsh # list
 Id Name                 State
----------------------------------
virsh #
[root@server01 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
[root@server01 ~]# service libvirtd status
libvirtd (pid  2678) is running...
[root@server01 ~]#

[root@server01 ~]# virt-clone
ERROR    An original machine name or xml file is required.
[root@server01 ~]#

No more for KVM for me , unless I wanna scrub my corporate labtop and install RHEL6 on bare metal, can't do that, so gonna stop this one for now , sorry....no KVM for you !

No comments:

Post a Comment