Create Volume Group and Logical Volume and Assign to Partition mkvg, mklv and mkvdev

Create Volume Group and Logical Volume and Assign to LPAR 

The creation of Logical Volume is a concept of PowerVM virtualization where a huge disk of size foe example 400GB can be broken down in to 40GB small small logical volumes and assigned to 10 logical partitions.



Creation of volume group and logical volume

With this we get in to creation of volume group, as from the name suggests volume group is a group of physical volume (hard disks) creating a pool called volume group. Assuming the Virtual I/O Server has 400GB of hard disk connected to it we first create a volume group (yourvg). After successfully creating the yourvg volume group we divide the volume group in to small size of logical volume (LV) of 40 GB size as provided by given example.

$ lspv -free | grep 409600
NAME            PVID                                SIZE(megabytes)  
hdisk18         none                                409600
$
$ mkvg -f -vg yourvg hdisk18
hdisk18 changed
yourvg
0516-1254 mkvg: Changing the PVID in the ODM. 
$
$ lsvg | grep your
yourvg
$
$
$ mklv -lv logicvol01 yourvg 40G
logicvol01

$
$ bootinfo -s logicvol01
40960
$

Assigning the logical volume to LPAR 

After successfully creating the volume group and logical volume we need to map the logical volume disk to a partition. To map the disk to partition we need to find the parttion ID and its virtual scsi adapter. Once these are identified will map the logical volume using mkvdev as given below

$ lsmap -all
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3          U8286.42A.TU00001-V2-C12                     0x00000005

VTD                   lpar5
Status                Available
LUN                   0x8100000000000000
Backing device        hdisk7
Physloc               
Mirrored              N/A

$
$ mkvdev -vadapter vhost3 -vdev logicvol01
vtscsi0 Available
$
$ lsmap -all 
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3          U8286.42A.TU00001-V2-C12                     0x00000005

VTD                   lpar5
Status                Available
LUN                   0x8100000000000000
Backing device        hdisk7
Physloc               
Mirrored              N/A

VTD                   vtscsi0
Status                Available
LUN                   0x8200000000000000
Backing device        logicvol01
Physloc               
Mirrored              N/A
$
$

Removing the mapping and logical volume

To remove the mapping between the logical volume and LPAR we need to remove the vtscsi device that was configured earlier

$ rmdev -dev vtscsi0
vtscsi0 deleted
$

To remove the logical volume we need to execute rmlv once the logical volume is free from the mapping and is not being used by any partition.

$ rmlv -f logicvol01
rmlv: Logical volume logicvol01 is removed.




Post a Comment

0 Comments