怎样创建lpar通过HMC/VIOS和动态加disk
以下描述了如何创建lpar通过HMC/VIOS(动态加disk),lpar是系统盘是通过dd一个已经装好aix的LV. 已经装好aix的LV,这个相当于镜像。可以用这个镜像dd出一个系统盘,然后用作lpar的系统盘,再动态挂载一个数据盘,然后卸载系统盘,然后全部清除掉。
这个过程尽量match虚拟机管理的一般流程。
1. create lv on vios
mklv -lv lvdisk1 rootvg 50G
lsvg -lv rootvg
//on vios, dd lvdisk1 from image(lv_testrvg)
lsmap -all -type disk lv
oem_setup_env
dd if=/dev/lv_testrvg of=/dev/lvdisk1 bs=1m
2. create vscsi server of vios on HMC
chhwres -r virtualio -m Server-8231-E2B-SN064B14R -o a -p vios --rsubtype scsi -a "adapter_type=server"
lshwres -r virtualio -m Server-8231-E2B-SN064B14R --level lpar --rsubtype scsi --filter "lpar_names=vios"
lpar_name=vios,lpar_id=2,slot_num=3,state=1,is_required=0,adapter_type=server,remote_lpar_id=any,remote_lpar_name=,remote_slot_num=any
lpar_name=vios,lpar_id=2,slot_num=5,state=1,is_required=0,adapter_type=server,remote_lpar_id=any,remote_lpar_name=,remote_slot_num=any
lpar_name=vios,lpar_id=2,slot_num=6,state=1,is_required=0,adapter_type=server,remote_lpar_id=4,remote_lpar_name=null,remote_slot_num=2
lpar_name=vios,lpar_id=2,slot_num=7,state=1,is_required=0,adapter_type=server,remote_lpar_id=any,remote_lpar_name=,remote_slot_num=any
3. mkvdev on vios
$ lsdev -slots
# Slot Description Device(s)
U8231.E2B.064B14R-V2-C0 Virtual I/O Slot vsa0
U8231.E2B.064B14R-V2-C2 Virtual I/O Slot ent4
U8231.E2B.064B14R-V2-C3 Virtual I/O Slot vhost0
U8231.E2B.064B14R-V2-C4 Virtual I/O Slot vfchost0
U8231.E2B.064B14R-V2-C5 Virtual I/O Slot vhost1
U8231.E2B.064B14R-V2-C6 Virtual I/O Slot vhost2
U8231.E2B.064B14R-V2-C7 Virtual I/O Slot vhost3
mkvdev -vdev lv_jzhao -vadapter vhost3 -dev vc_disk1 //lv_jzhao is the lv disk after dd
4. create lpar
lsmap -all -net //on vios, get vlan
mksyscfg -r lpar -m Server-8231-E2B-SN064B14R -i "name=jzhaovm1,profile_name=jzhaovm1,lpar_env=aixlinux,min_mem=256,desired_mem=1024,max_mem=1024,proc_mode=ded,min_procs=1,desired_procs=1,max_procs=2,sharing_mode=share_idle_procs,boot_mode=norm,virtual_scsi_adapters=2/client/2/vios/7/0,virtual_eth_adapters=3/0/1//0/0,max_virtual_slots=20"
lssyscfg -m Server-8231-E2B-SN064B14R -r prof
lssyscfg -r lpar -m Server-8231-E2B-SN064B14R -F name:lpar_id:state
chsysstate -m Server-8231-E2B-SN064B14R -r lpar -o on --id 4 -f jzhaovm1
5. access AIX
telnet 10.0.xx.xx
lsdev -Cc disk
6. add second disk
//on vios
mklv -lv lvdisk2 rootvg 15G
lsvg -lv rootvg
//create vscsi server of vios on HMC
chhwres -r virtualio -m Server-8231-E2B-SN064B14R -o a -p vios --rsubtype scsi -a "adapter_type=server"
lshwres -r virtualio -m Server-8231-E2B-SN064B14R --level lpar --rsubtype scsi --filter "lpar_names=vios"
on vios: mkvdev -vdev lvdisk2 -vadapter vhost4 -dev vc_disk2
# vhost4 is related with vios vscsi server slot.
lpar: add vscsi cleint
//on HMC
chhwres -r virtualio -m Server-8231-E2B-SN064B14R -o a -p jzhaovm1 --rsubtype scsi -a "adapter_type=client,,remote_lpar_name=vios,remote_slot_num=8"
lshwres -r virtualio -m Server-8231-E2B-SN064B14R --level lpar --rsubtype scsi --filter "lpar_names=jzhaovm1"
//on lpar:
cfgmgr
# lsdev -Cc disk
hdisk0 Defined Virtual SCSI Disk Drive
hdisk1 Available Virtual SCSI Disk Drive
hdisk2 Available Virtual SCSI Disk Drive
7. unattach second disk
//on lpar:
lsdev
rmdev -dl hdisk2
rmdev -Rdl vscsi1
hdisk2 deleted
vscsi1 deleted
//on HMC
lshwres -r virtualio --rsubtype scsi -m Server-8231-E2B-SN064B14R --level lpar
chhwres -r virtualio -m Server-8231-E2B-SN064B14R -o r -p jzhaovm1 --rsubtype scsi -s 4
rmvdev -vtd vc_disk2 //on vios
chhwres -r virtualio -m Server-8231-E2B-SN064B14R -o r -p vios --rsubtype scsi -s 8 //for disk2 of lpar
8. remove lpar on HMC
chsysstate -r lpar -m Server-8231-E2B-SN064B14R -n jzhaovm1 -o shutdown --immed
rmsyscfg -r lpar -m Server-8231-E2B-SN064B14R -n jzhaovm1
rmvdev -vtd vc_disk1 //on vios
chhwres -r virtualio -m Server-8231-E2B-SN064B14R -o r -p vios --rsubtype scsi -s 7
9. remove lv disk on vios
rmlv lv_disk2
10. other command:
lscfg -vpl hdiskX
lssyscfg -m SVRP8-S822-03-SN847A74V -r prof
bootinfo -s hdiskX
上一篇: [扩展欧拉函数] POJ2142The Balance
下一篇: C语言中的可变参数列表