To use LVM-based guests, you need a volume group that has some free space that is not allocated to any logical volume.
In this example, I use the volume group /dev/vg_server1 with a size of approx. 465GB...
vgdisplay
[root@server1 ~]# vgdisplay
--- Volume group ---
VG Name vg_server1
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 465.28 GiB
PE Size 4.00 MiB
Total PE 119112
Alloc PE / Size 26500 / 103.52 GiB
Free PE / Size 92612 / 361.77 GiB
that contains the logical volumes /dev/vg_server1/LogVol00 with a size of approx. 100GB and /dev/vg_server1/LogVol01 (about 6GB) - the rest is not allocated and can be used for KVM guests:
lvdisplay
[root@server1 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/vg_server1/LogVol01
LV Name LogVol01
VG Name vg_server1
LV UUID uUpXY3-yGfZ-X6bc-3D1u-gB4E-CfKE-vDcNfw
LV Write Access read/write
LV Creation host, time server1.example.com, 2012-08-21 13:45:32 +0200
LV Status available
# open 1
LV Size 5.86 GiB
Current LE 1500
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg_server1/LogVol00
LV Name LogVol00
VG Name vg_server1
LV UUID FN1404-Aczo-9dfA-CnNI-IKn0-L2hW-Aix0rV
LV Write Access read/write
LV Creation host, time server1.example.com, 2012-08-21 13:45:33 +0200
LV Status available
# open 1
LV Size 97.66 GiB
Current LE 25000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
Or you can reinstall the OS and create a lvm partition as below
=======
df
====
/dev/md125 ext4 476M 150M 298M 34% /boot
/dev/mapper/lvroot-home ext4 85G 5.8G 75G 8% /home
/dev/md126 ext4 40G 3.3G 35G 9% /
Install required KVM RPMs/packages
# yum groupinstall "Virtualisation Tools" "Virtualization Platform"
# yum install python-virtinst
# chkconfig libvirtd on
# service libvirtd status
libvirtd (pid 31128) is running...
# virsh list
Setup will be like below
+-------------+
| CentOS/RHEL | |-----|
-->ISP router---+ Box Host w/ +--- eth0 -->-+ br0 + Private IP
| KVM | | |
+-------------+--- eth1 -->-+ br1 | Public IP
|-----|
|
vm1-+---vm2----vm3---vm4
*** NOTE: each VMs will have two interface i.e. Private and Public *****
===================
Install and configure a network bridge
=============================================
KVM network setup
============
[root@vz2 template]# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
BROADCAST=IP
IPADDR= Main IP
GATEWAY=IP
NETMASK=255.255.255.X
NETWORK=IP
ONBOOT=yes
=========
>> /etc/sysconfig/network-scripts/ifcfg-eno1
DEVICE=eno1
TYPE=Ethernet
HWADDR=check with hw
IPV6INIT=yes
IPV6_AUTOCONF=yes
ONBOOT=yes
BRIDGE=br0
==========================================================================
Next steps >> solusvm master /slave installation steps
Sreejith Anchal >> ping me @ s9400578382@gmail.com , if need.
In this example, I use the volume group /dev/vg_server1 with a size of approx. 465GB...
vgdisplay
[root@server1 ~]# vgdisplay
--- Volume group ---
VG Name vg_server1
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 465.28 GiB
PE Size 4.00 MiB
Total PE 119112
Alloc PE / Size 26500 / 103.52 GiB
Free PE / Size 92612 / 361.77 GiB
that contains the logical volumes /dev/vg_server1/LogVol00 with a size of approx. 100GB and /dev/vg_server1/LogVol01 (about 6GB) - the rest is not allocated and can be used for KVM guests:
lvdisplay
[root@server1 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/vg_server1/LogVol01
LV Name LogVol01
VG Name vg_server1
LV UUID uUpXY3-yGfZ-X6bc-3D1u-gB4E-CfKE-vDcNfw
LV Write Access read/write
LV Creation host, time server1.example.com, 2012-08-21 13:45:32 +0200
LV Status available
# open 1
LV Size 5.86 GiB
Current LE 1500
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg_server1/LogVol00
LV Name LogVol00
VG Name vg_server1
LV UUID FN1404-Aczo-9dfA-CnNI-IKn0-L2hW-Aix0rV
LV Write Access read/write
LV Creation host, time server1.example.com, 2012-08-21 13:45:33 +0200
LV Status available
# open 1
LV Size 97.66 GiB
Current LE 25000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
Or you can reinstall the OS and create a lvm partition as below
=======
df
====
/dev/md125 ext4 476M 150M 298M 34% /boot
/dev/mapper/lvroot-home ext4 85G 5.8G 75G 8% /home
/dev/md126 ext4 40G 3.3G 35G 9% /
Install required KVM RPMs/packages
# yum groupinstall "Virtualisation Tools" "Virtualization Platform"
# yum install python-virtinst
# chkconfig libvirtd on
# service libvirtd status
libvirtd (pid 31128) is running...
# virsh list
Setup will be like below
+-------------+
| CentOS/RHEL | |-----|
-->ISP router---+ Box Host w/ +--- eth0 -->-+ br0 + Private IP
| KVM | | |
+-------------+--- eth1 -->-+ br1 | Public IP
|-----|
|
vm1-+---vm2----vm3---vm4
*** NOTE: each VMs will have two interface i.e. Private and Public *****
===================
Install and configure a network bridge
=============================================
KVM network setup
============
[root@vz2 template]# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
BROADCAST=IP
IPADDR= Main IP
GATEWAY=IP
NETMASK=255.255.255.X
NETWORK=IP
ONBOOT=yes
=========
>> /etc/sysconfig/network-scripts/ifcfg-eno1
DEVICE=eno1
TYPE=Ethernet
HWADDR=check with hw
IPV6INIT=yes
IPV6_AUTOCONF=yes
ONBOOT=yes
BRIDGE=br0
==========================================================================
Next steps >> solusvm master /slave installation steps
Sreejith Anchal >> ping me @ s9400578382@gmail.com , if need.
No comments:
Post a Comment