[PowerVM] 利vios给微分区扩容
前言:
一个P550小型机,两个300G硬盘,hdisk0和hdisk1,利用PowerVM技术建立三台虚拟机,AIX1独占1个300G硬盘hdisk1,hdisk0使用vios建立成一个rootvg,AIX2和Linux for power分别使用rootvg两个100G的LV,日常使用中AIX2空间不足,需要给AIX2扩容。下面将使用VIOS、AIX2作为前缀说明执行的环境。VIOS:$oem_setup_env
VIOS:#lsvg
rootvg
VIOS:#:lsvg -l rootvg //本处忽略了其他没关的显示信息
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
aix2 jfs2 200 200 1 open / syncd N / A
redhat jfs2 200 200 1 open / syncd N / A
VIOS:#exit
aix2 jfs2 200 200 1 open / syncd N / A
redhat jfs2 200 200 1 open / syncd N / A
VIOS:$lsmap -all //本处忽略了其他没关的显示信息
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost0 U8204.E8A.0628AD4 - V1 - C21 0x00000002
VTD aix1_rootvg
Status Available
LUN 0x8100000000000000
Backing device hdisk1
Physloc U78A0. 001 .DNWH1L3 - P2 - D6
VTD cd
Status Available
LUN 0x8200000000000000
Backing device cd0
Physloc U78A0. 001 .DNWH1L3 - P2 - D2
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost1 U8204.E8A.0628AD4 - V1 - C22 0x00000003
VTD aix2rootvg
Status Available
LUN 0x8100000000000000
Backing device aix2
Physloc
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost2 U8204.E8A.0628AD4 - V1 - C23 0x00000004
VTD redhatvg
Status Available
LUN 0x8100000000000000
Backing device redhat
Physloc
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3 U8204.E8A.0628AD4 - V1 - C24 0x00000000
VTD NO VIRTUAL TARGET DEVICE FOUND
--------------- -------------------------------------------- ------------------
vhost0 U8204.E8A.0628AD4 - V1 - C21 0x00000002
VTD aix1_rootvg
Status Available
LUN 0x8100000000000000
Backing device hdisk1
Physloc U78A0. 001 .DNWH1L3 - P2 - D6
VTD cd
Status Available
LUN 0x8200000000000000
Backing device cd0
Physloc U78A0. 001 .DNWH1L3 - P2 - D2
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost1 U8204.E8A.0628AD4 - V1 - C22 0x00000003
VTD aix2rootvg
Status Available
LUN 0x8100000000000000
Backing device aix2
Physloc
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost2 U8204.E8A.0628AD4 - V1 - C23 0x00000004
VTD redhatvg
Status Available
LUN 0x8100000000000000
Backing device redhat
Physloc
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3 U8204.E8A.0628AD4 - V1 - C24 0x00000000
VTD NO VIRTUAL TARGET DEVICE FOUND
AIX2:# lspv
hdisk0 00c28ad458c8499d rootvg active
AIX2:# lspv hdisk0
PHYSICAL VOLUME: hdisk0 VOLUME GROUP: rootvg
PV IDENTIFIER: 00c28ad458c8499d VG IDENTIFIER 00c28ad400004c000000012d58c8560d
PV STATE: active
STALE PARTITIONS: 0 ALLOCATABLE: yes
PP SIZE: 128 megabyte(s) LOGICAL VOLUMES: 15
TOTAL PPs: 799 ( 102272 megabytes) VG DESCRIPTORS: 2
FREE PPs: 24 ( 3072 megabytes) HOT SPARE: no
USED PPs: 775 ( 99200 megabytes) MAX REQUEST: 256 kilobytes
FREE DISTRIBUTION: 08 .. 00 .. 00 .. 00 .. 16
USED DISTRIBUTION: 152 .. 160 .. 159 .. 160 .. 144
PV IDENTIFIER: 00c28ad458c8499d VG IDENTIFIER 00c28ad400004c000000012d58c8560d
PV STATE: active
STALE PARTITIONS: 0 ALLOCATABLE: yes
PP SIZE: 128 megabyte(s) LOGICAL VOLUMES: 15
TOTAL PPs: 799 ( 102272 megabytes) VG DESCRIPTORS: 2
FREE PPs: 24 ( 3072 megabytes) HOT SPARE: no
USED PPs: 775 ( 99200 megabytes) MAX REQUEST: 256 kilobytes
FREE DISTRIBUTION: 08 .. 00 .. 00 .. 00 .. 16
USED DISTRIBUTION: 152 .. 160 .. 159 .. 160 .. 144
AIX2:# lsvg
rootvg
AIX2:# lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 00c28ad400004c000000012d58c8560d
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read / write TOTAL PPs: 799 ( 102272 megabytes)
MAX LVs: 256 FREE PPs: 24 ( 3072 megabytes)
LVs: 15 USED PPs: 775 ( 99200 megabytes)
OPEN LVs: 14 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
可见AIX2只挂载了一个分区。
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read / write TOTAL PPs: 799 ( 102272 megabytes)
MAX LVs: 256 FREE PPs: 24 ( 3072 megabytes)
LVs: 15 USED PPs: 775 ( 99200 megabytes)
OPEN LVs: 14 QUORUM: 2 (Enabled)
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
下面利用vios创建一个给AIX2使用的vg
VIOS:#mklv -y aix2datavg -t jfs2 rootvg 50G //命令解释:在rootvg创建一个50G名为aix2datavg的jfs2格式的lv
aix2datavg
lv创建完毕,下面将lv映射给AIX2
VIOS:$mkvdev -vdev aix2datavg -vadapter vhost1 //命令解释:创建一个虚拟设备,并映射给vhost1(即AIX2,由lsmap命令知道),可以加-dev参数为新虚拟设备命名
vtscsi0 Available
由于没指定虚拟设备名称,此处系统默认分配了一个vtscsi0
执行lsmap查看是否已经映射成功。
VIOS:$lsmap -all
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost0 U8204.E8A.0628AD4 - V1 - C21 0x00000002
VTD aix1_rootvg
Status Available
LUN 0x8100000000000000
Backing device hdisk1
Physloc U78A0. 001 .DNWH1L3 - P2 - D6
VTD cd
Status Available
LUN 0x8200000000000000
Backing device cd0
Physloc U78A0. 001 .DNWH1L3 - P2 - D2
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost1 U8204.E8A.0628AD4 - V1 - C22 0x00000003
VTD aix2rootvg
Status Available
LUN 0x8100000000000000
Backing device aix2
Physloc
VTD vtscsi0
Status Available
LUN 0x8200000000000000
Backing device aix2datavg
Physloc
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost2 U8204.E8A.0628AD4 - V1 - C23 0x00000004
VTD redhatvg
Status Available
LUN 0x8100000000000000
Backing device redhat
Physloc
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3 U8204.E8A.0628AD4 - V1 - C24 0x00000000
VTD NO VIRTUAL TARGET DEVICE FOUNDk可见
可见vhost1已经增加了vtscsi0
--------------- -------------------------------------------- ------------------
vhost0 U8204.E8A.0628AD4 - V1 - C21 0x00000002
VTD aix1_rootvg
Status Available
LUN 0x8100000000000000
Backing device hdisk1
Physloc U78A0. 001 .DNWH1L3 - P2 - D6
VTD cd
Status Available
LUN 0x8200000000000000
Backing device cd0
Physloc U78A0. 001 .DNWH1L3 - P2 - D2
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost1 U8204.E8A.0628AD4 - V1 - C22 0x00000003
VTD aix2rootvg
Status Available
LUN 0x8100000000000000
Backing device aix2
Physloc
VTD vtscsi0
Status Available
LUN 0x8200000000000000
Backing device aix2datavg
Physloc
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost2 U8204.E8A.0628AD4 - V1 - C23 0x00000004
VTD redhatvg
Status Available
LUN 0x8100000000000000
Backing device redhat
Physloc
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost3 U8204.E8A.0628AD4 - V1 - C24 0x00000000
VTD NO VIRTUAL TARGET DEVICE FOUNDk可见
利用HMC管理平台重启AIX2
AIX2:# lspv
hdisk0 00c28ad458c8499d rootvg active
hdisk1 none None
可见AIX2已经成功添加了一个pv hdisk1,但是还没分配给创建vg
hdisk1 none None
AIX2:# mkvg hdisk1
0516
-
1254
mkvg: Changing the PVID
in
the ODM.
vg00
vg00
AIX2:# lspv
hdisk0 00c28ad458c8499d rootvg active
hdisk1 00c28ad46d8b5773 vg00 active
可见新的lv已经分配给新的vg00,并且状态是激活的。
hdisk1 00c28ad46d8b5773 vg00 active
至此,本次给AIX2扩容已经完成了一半。
因为IBM PowerVM先进的虚拟化技术,实际应用中可以实现在线扩容。本次虽然扩容了,但是重启了AIX2,只能算完成一半。在线扩容还没掌握好,下次再实践。