Sunday, November 21, 2010

Virtualization on RHEL 5

-xen is the basis for virtualization in RHEL 5

-Advantages of virtualization

1-effective resource usage

2-easy management

para virtualization-same arch os support

full virtualization-any arch os support 

-para virtualization

packages-

kernel-xen from pub/Server

Virt-Manager from pub/VT

yum install kernel-xen
yum install virt-manager
yum install xen

uname -r
reboot system

application->system tools->Virtual machine manager->new




To automatically run the guest after a system (Dom0) reboot, we have to create the following link:

# ln -s /etc/xen/[guest_name] /etc/xen/auto/

We can manage the Xen Guest with xm commands, virsh commands or virt-manager.

Virt-Manager
# virt-manager



xm commands
List Domains (Xen Guests)

# xm list
Start a Guest

# xm create [guest-config]
Connect to a guest console ( Back: ESC-] (US-keyboard), Ctrl-5 (German keyboard))

# xm console [guest_name]
Shutdown a guest

# xm shutdown [guest_name]
Destroy (Power off) a guest

# xm destroy [guest_name]
Monitor guests

# xm top


virsh commands
# virsh
virsh # help 

Commands:

    autostart       autostart a domain
    capabilities    capabilities
    connect         (re)connect to hypervisor
    console         connect to the guest console
    create          create a domain from an XML file
    start           start a (previously defined) inactive domain
    destroy         destroy a domain
    define          define (but don't start) a domain from an XML file
    domid           convert a domain name or UUID to domain id
    domuuid         convert a domain name or id to domain UUID
    dominfo         domain information
    domname         convert a domain id or UUID to domain name
    domstate        domain state
    dumpxml         domain information in XML
    help            print help
    list            list domains
    net-autostart   autostart a network
    net-create      create a network from an XML file
    net-define      define (but don't start) a network from an XML file
    net-destroy     destroy a network
    net-dumpxml     network information in XML
    net-list        list networks
    net-name        convert a network UUID to network name
    net-start       start a (previously defined) inactive network
    net-undefine    undefine an inactive network
    net-uuid        convert a network name to network UUID
    nodeinfo        node information
    quit            quit this interactive terminal
    reboot          reboot a domain
    restore         restore a domain from a saved state in a file
    resume          resume a domain
    save            save a domain state to a file
    schedinfo       show/set scheduler parameters
    dump            dump the core of a domain to a file for analysis
    shutdown        gracefully shutdown a domain
    setmem          change memory allocation
    setmaxmem       change maximum memory limit
    setvcpus        change number of virtual CPUs
    suspend         suspend a domain
    undefine        undefine an inactive domain
    vcpuinfo        domain vcpu information
    vcpupin         control domain vcpu affinity
    version         show version
    vncdisplay      vnc display
    attach-device   attach device from an XML file
    detach-device   detach device from an XML file
    attach-interface attach network interface
    detach-interface detach network interface
    attach-disk     attach disk device
    detach-disk     detach disk device
Exp.: Start a guest with virsh

# virsh start [guest_name]

No comments:

Post a Comment