AIX New lpar creation HMC NIM Do it in command line
id : 9639q1ayc5
category : computer
blog : unixlinux
created : 12/16/11 - 14:31:09

On nim

  • remove machine object if existe :
# nim -o remove lpar1

  • creating nim machine object for lpar 1 :
# nim -o define -t standalone -a platform=chrp -a netboot_kernel=64 -a if1="vlan858-10_246_58-59 lpar1 0" -a cable_type1="N/A" -a connect=nimsh lpar1

  • cleaning used ressources :
# nim -Fo reset lpar1
# nim -o deallocate -a subclass=all lpar1

  • creating of bosinst_data for no prompt installation :
# cat > /nim/bosinst_data/lpar1_bostinst_data << EOF
control_flow:
    CONSOLE = Default
    INSTALL_METHOD = overwrite
    INSTALL_EDITION = enterprise
    PROMPT = no
    EXISTING_SYSTEM_OVERWRITE = any
    INSTALL_X_IF_ADAPTER = no
    RUN_STARTUP = no
    RM_INST_ROOTS = no
    ERROR_EXIT =
    CUSTOMIZATION_FILE =
    TCB = no
    INSTALL_TYPE =
    BUNDLES =
    RECOVER_DEVICES = Default
    BOSINST_DEBUG = no
    ACCEPT_LICENSES = yes
    DESKTOP = CDE
    INSTALL_DEVICES_AND_UPDATES = yes
    IMPORT_USER_VGS =
    ENABLE_64BIT_KERNEL = Default
    CREATE_JFS2_FS = Default
    ALL_DEVICES_KERNELS = yes
    GRAPHICS_BUNDLE = yes
    MOZILLA_BUNDLE = no
    KERBEROS_5_BUNDLE = no
    SERVER_BUNDLE = no
    REMOVE_JAVA_118 = no
    HARDWARE_DUMP = yes
    ADD_CDE = no
    ADD_GNOME = no
    ADD_KDE = no
    ERASE_ITERATIONS = 0
    ERASE_PATTERNS =
    MKSYSB_MIGRATION_DEVICE =

target_disk_data:
    LOCATION =
    SIZE_MB =
    HDISKNAME =

locale:
    BOSINST_LANG =
    CULTURAL_CONVENTION =
    MESSAGES =
    KEYBOARD =
EOF
# nim -o define -t bosinst_data -a location="/nim/bosinst_data/lpar1_bostinst_data" -a server="master" lpar1_bosinst_data

  • define postinstall script and fb script :
# nim -o define -t script -a location="/nim/postinstall_script/lpar1_postinstall.ksh" -a server=master lpar1_postinstall
# nim -o define -t fb_script -a location="/nim/fb_script/lpar1_fbinstall.ksh" -a server=master lpar1_fb_script

  • running bos_inst :
nim -o bos_inst -a source=rte -a bosinst_data=lpar1_bostinst_data -a script=lpar1_postinstall -a fb_script=lpar1_fb_script -a accept_licenses=yes -a spot=spot_aix610TL06 -a lpp_source=lpp_aix610TL06 -a no_client_boot=yes lpar1

On HMC

Virtual switch creation
  • creating new vswitch :
# chhwres -r virtualio -m FRAME1 --rsubtype vswitch -o a --vswitch VSWITCH1

Lpar creation
  • lpar_creation :
# mksyscfg -r lpar -m FRAME1 -i lpar_id=3, name=lpar1, profile_name=lpar1-profile, lpar_env=aixlinux, shared_proc_pool_util_auth=1, min_mem=1024, desired_mem=12288, max_mem=18432, proc_mode=shared, min_proc_units=0.5, desired_proc_units=1.2, max_proc_units=12, min_procs=1, desired_procs=4, max_procs=12, sharing_mode=uncap, uncap_weight=128, boot_mode=norm, conn_monitoring=1, shared_proc_pool_util_auth=1

  • maxing virtual slots id :
chsyscfg -m FRAME1 -r prof -i 'name=lpar1-profile,lpar_id=3,max_virtual_slots=255'

  • adding virtual ethernet adapters :
# chsyscfg -m FRAME1 -r prof -i 'name=lpar1-profile,lpar_id=3,"virtual_eth_adapters=4/0/858//0/1/VSWITCH1,5/0/1078//0/1/VSWITCH1"'

  • virtual_eth_adapters : slot_num/ieee_virtual_eth/port_vlan_id/[addl_vlan_ids]/[trunk_priority]/is_required[/[vswitch][/[mac_addr]/[allowed_os_mac_addrs]/[qos_priority]]]
  • adding virtual fibre channels adapter client :
# chsyscfg -m FRAME1 -r prof -i 'name=lpar1-profile,lpar_id=3,"virtual_fc_adapters=10/Client/1/vios1/300//1,11/Client/1/vios1/301//1,12/Client/2/vios2/302//1,13/Client/2/vios2/303//1"

  • virtual_fc_adapters : slot_num/adapter_type/[remote_lpar_id]/[remote_lpar_name]/remote_slot_num/[wwpns]/is_required
  • virtual_scsi_adapters : slot_num/adapter_type/[remote_lpar_id]/[remote_lpar_name]/[remote_slot_num]/is_required
Modfiying vio server profiles for new lpar
  • maxing virtual slots id :
# chsyscfg -m FRAME1 -r prof -i 'name=vios1-profile,lpar_id=1,max_virtual_slots=2048'
# chsyscfg -m FRAME1 -r prof -i 'name=vios2-profile,lpar_id=2,max_virtual_slots=2048'

  • adding virtual fibre channels adapter server :
# chsyscfg -m FRAME1 -r prof -i 'name=vios1-profile,lpar_id=1,"virtual_fc_adapters+=300/Server/3/lpar1/10//1,301/Server/7/lpar1/11//1"'
# chsyscfg -m FRAME1 -r prof -i 'name=vios2-profile,lpar_id=2,"virtual_fc_adapters+=302/Server/3/lpar1/12//1,303/Server/7/lpar1/13//1"'

  • virtual_fc_adapters : slot_num/adapter_type/[remote_lpar_id]/[remote_lpar_name]/remote_slot_num/[wwpns]/is_required
  • virtual_scsi_adapters : slot_num/adapter_type/[remote_lpar_id]/[remote_lpar_name]/[remote_slot_num]/is_required
  • adding virtual ethernet adapter :
# chsyscfg -r prof -m FRAME1 -i 'name=vios1-profile,lpar_id=1,"virtual_eth_adapters+=254/1/999/855 856 857 858/1/1/VSWITCH1,253/0/4094//0/1/VSWITCH1"'
# chsyscfg -r prof -m FRAME1 -i 'name=vios2-profile,lpar_id=2,"virtual_eth_adapters+=254/1/999/855 856 857 858/2/1/VSWITCH1,253/0/4094//0/1/VSWITCH1"'
# chsyscfg -r prof -m FRAME1 -i 'name=vios1-profile,lpar_id=1,"virtual_eth_adapters+=252/1/998/1078/1/1/VSWITCH1,251/0/4093//0/1/VSWITCH1"'
# chsyscfg -r prof -m FRAME1 -i 'name=vios2-profile,lpar_id=2,"virtual_eth_adapters+=252/1/998/1078/2/1/VSWITCH1,251/0/4093//0/1/VSWITCH1"'

  • virtual_eth_adapters : slot_num/ieee_virtual_eth/port_vlan_id/[addl_vlan_ids]/[trunk_priority]/is_required[/[vswitch][/[mac_addr]/[allowed_os_mac_addrs]/[qos_priority]]]
  • If vio server can't be rebooted use these command to add adapter :
  • adding virtual fibre channels adapter server :
chhwres -r virtualio -m FRAME1 -o a --id 1 --rsubtype fc -s 301 -a "adapter_type=server,remote_lpar_name=lpar1,remote_slot_num=10"
chhwres -r virtualio -m FRAME1 -o a --id 1 --rsubtype fc -s 302 -a "adapter_type=server,remote_lpar_name=lpar1,remote_slot_num=11"
chhwres -r virtualio -m FRAME1 -o a --id 2 --rsubtype fc -s 303 -a "adapter_type=server,remote_lpar_name=lpar1,remote_slot_num=12"
chhwres -r virtualio -m FRAME1 -o a --id 2 --rsubtype fc -s 304 -a "adapter_type=server,remote_lpar_name=lpar1,remote_slot_num=13"

  • fc : adapter_type (client | server), remote_lpar_id | remote_lpar_name, remote_slot_num, wwpns
  • scsi : adapter_type (client | server), remote_lpar_id | remote_lpar_name, remote_slot_num
  • adding virtual ethernet adapter :
chhwres -r virtualio -m FRAME1 -o a --id 1 --rsubtype eth -s 254 -a "ieee_virtual_eth=1,port_vlan_id=999,addl_vlan_ids=855 856 857 858,is_trunk=1,trunk_priority=1,vswitch=VSWITCH1"
chhwres -r virtualio -m FRAME1 -o a --id 1 --rsubtype eth -s 253 -a "ieee_virtual_eth=0,port_vlan_id=4094,is_trunk=0,vswitch=VSWITCH1"
chhwres -r virtualio -m FRAME1 -o a --id 2 --rsubtype eth -s 254 -a "ieee_virtual_eth=1,port_vlan_id=999,addl_vlan_ids=855 856 857 858,is_trunk=1,trunk_priority=2,vswitch=VSWITCH1"
chhwres -r virtualio -m FRAME1 -o a --id 2 --rsubtype eth -s 254 -a "ieee_virtual_eth=0,port_vlan_id=4094,is_trunk=0,vswitch=VSWITCH1"
chhwres -r virtualio -m FRAME1 -o a --id 1 --rsubtype eth -s 252 -a "ieee_virtual_eth=1,port_vlan_id=998,addl_vlan_ids=1078,is_trunk=1,trunk_priority=1,vswitch=VSWITCH1"
chhwres -r virtualio -m FRAME1 -o a --id 1 --rsubtype eth -s 251 -a "ieee_virtual_eth=0,port_vlan_id=4093,is_trunk=0,vswitch=VSWITCH1"
chhwres -r virtualio -m FRAME1 -o a --id 2 --rsubtype eth -s 252 -a "ieee_virtual_eth=1,port_vlan_id=998,addl_vlan_ids=1078,is_trunk=1,trunk_priority=2,vswitch=VSWITCH1"
chhwres -r virtualio -m FRAME1 -o a --id 2 --rsubtype eth -s 251 -a "ieee_virtual_eth=0,port_vlan_id=4093,is_trunk=0,vswitch=VSWITCH1" 

  • eth : mac_prefix, ieee_virtual_eth (0 | 1), port_vlan_id, addl_vlan_ids, is_trunk (0 | 1), trunk_priority, vswitch, mac_addr, allowed_os_mac_addrs, qos_priority
Getting WWN
  • get virtual wwn :
# lssyscfg -r prof -m FRAME1 -Fname,virtual_fc_adapters --header | grep ^lpar1

Usefull commands to start stop lpar
  • stopping lpar :
# chsysstate -m FRAME1 -r lpar -o shutdown --immed -n lpar1

  • boot sms :
# chsysstate -m FRAME1 -r lpar -o on -b sms -n lpar1 -f lpar1-profile

  • boot normal :
# chsysstate -m FRAME1 -r lpar -o on -b norm -n lpar1 -f lpar1-profile

  • boot open firmware :
# chsysstate -m FRAME1 -o on -r lpar -n lpar1 -f lpar1-profile -b of

Starting installation from HMC
  • stopping lpar if running :
# chsysstate -m FRAME1 -r lpar -o shutdown --immed -n lpar1

  • removing opened vterm :
# rmvterm -m FRAME1 -p lpar1

  • ping test :
# lpar_netboot -M -A -n -T off -t ent -D -s auto -d auto -S 10.246.70.17 -G 10.246.59.254 -C 10.246.58.31 -K 255.255.254.0 lpar1 lpar1-profile FRAME1
Connecting to lpar1
Connected
Checking for power off.
Power off the node
Wait for power off.
Power off complete.
Power on lpar1 to Open Firmware.
Power on complete.
Client IP address is 10.246.58.31.
Server IP address is 10.246.70.17.
Gateway IP address is 10.246.59.254.
Subnetmask IP address is 255.255.254.0.
Getting adapter location codes.
/vdevice/l-lan@30000004 ping successful.
Type   Location Code   MAC Address     Full Path Name  Ping Result     Device Type
ent U9117.MMB.106398P-V7-C4-T1 fa97fc229504 /vdevice/l-lan@30000004 successful virtual
/vdevice/l-lan@30000005 ping unsuccessful
ent U9117.MMB.106398P-V7-C5-T1 fa97fc229505 /vdevice/l-lan@30000005 unsuccessful virtual
/vdevice/l-lan@30000006 ping unsuccessful
ent U9117.MMB.106398P-V7-C6-T1 fa97fc229506 /vdevice/l-lan@30000006 unsuccessful virtual

  • launching lpar installation :
# lpar_netboot -t ent -l U9117.MMB.106398P-V7-C4-T1 -s auto -d auto -S 10.246.70.17 -G 10.246.59.254 -C 10.246.58.31 –K 255.255.254.0 "lpar1" "lpar1-profile" "FRAME1"
Connecting to lpar1
Connected
Checking for power off.
Power off complete.
Power on infsav5c1-lesica to Open Firmware.
Power on complete.
Getting adapter location codes.
Network booting install adapter.
bootp sent over network.
Network boot proceeding, lpar_netboot is exiting.
Finished.

  • opening vterm :
# mkvterm -m FRAME1 -p lpar1