Showing posts with label virtualisation. Show all posts
Showing posts with label virtualisation. Show all posts

Jan 14, 2015

Over-Committing And Ballooning in KVM

Over-Committing the resource is a vital part in Virtualization. Idea of over-committment is to allocate more memory to guest machines than the host really has. Suppose a 2GB host is running two guest operating system who is having 2GB memory, in this case we can say its over committed.

In Ballooning process, Host have a right to take the free memory from Guest machines if its there. Consider the above said example, where suppose one virtual machine is using 1GB and other 1GB is free, host can ask the guest to return the free memory. Guest will give it back and host can allocate somewhere else. And if the reduced guest wants to run an application that consumes more than the 1G it currently has, it has to grow again. 

virtio_balloon - This is the driver who open a communication pathway between Host and the Guest virtual machines. Hypervisor (Host) uses this communication pathway to over-committ the resource from Guest machines. If you are not loaded the virtio_balloon driver, you are not able to do the following.

1. The guest operating system ignores memory requests from the hypervisor.
2. The hypervisor cannot over-commit the memory.

The main problem is, this ballooning process is not automatic. it's entirely manual. Someone (or some tool) is supposed to be watching the pressure in the host and guest and then operate the balloon accordingly. In 2013 October KVM forum, Redhat introduced Automatic Ballooning. You can find the presented slides here, and its available with from Kernel 3.10 onwards. I would say, its still experimental and need more feedback.

May 1, 2012

KVM (Virtualization) Tips



KVM Tips.


Assumptions

1.You should have a working KVM Environment
2.You should have knowledge in Linux and little Networking.
3.You should have basic level knowledge in Virtualisation

1.To Check whether KVM has been installed

virsh -c qemu:///system list

You will see the following...

[root@server1 ~]# virsh -c qemu:///system list
 Id Name                 State
----------------------------------

[root@server1 ~]#

Which means your KVM server is up and running.

2.To View all the running Guests

virsh --connect qemu:///system

virsh# list -all

Id Name                 State
----------------------------------
  3 vm11                 running
  - vm10                 shut off

virsh #

3.Start a Virtual Machine
virsh# start vm10

4.Stop a Virtual Machine
virsh# shutdown vm10

5.Suspend a Virtual Machine

virsh# suspend vm10

6.Forcefully Shutdown a virtual Machine (ie remove power plug)

virsh# destroy vm10

7.Exit the Virtual shell
virsh# Exit

Apr 22, 2012

VLAN With Hypervisor - KVM

IDEA.


Some times we need a VLAN inside the Linux machine to communicate with outside network. Specifically when we are dealing with Blade Servers. KVM Hypervisor only allows outside traffic through this VLAN only OR Management IP. We are not considering management NIC here.

The traffic from BladeS erver is allowed to main switch only through this VLAN. When a packet come from the Blade , the particular port of the switch will ask challenge to the packet for VLAN information. So we need to create a separate VLAN inside the Linux machine.

HowTO

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.300

vi /etc/sysconfig/network-scripts/ifcfg-eth0.300

Find the Word DEVICE and change its name to eth0.300 (Normally that should be eth0)

Add the Line       VLAN=yes

Restart the Network    /etc/init.d/network restart.

Adding a new VLAN

vconfig add eth0 5

Assigning an IPAddress to the VLAN

ifconfig eth0.5 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255 up

For Shutting down a VLAN

ifdown eth0.300

For Remove a VLAN

vconfig rem eth0.300