COMMONLY USED COMMAND FOR HP-UX VPARS

Running HP-UX and utilizing VPARs? Below is a list of commonly used commands with VPAR version 6.1 and above.


Creating Virtual switches:
In VPAR version 6.1 the use of virtual switches to share LAN connections between vpar is now supported. VPAR historically were not allowed to share hardware. In VPAR 6.1 to allow VPAR to share LAN interfaces via a virtual switch the resources_reserve must be set to false. For more on resources_reserve see the VPAR 6.1 Admin guide. If you need to share LAN interfaces, resource_reserve has been set to false on both VSPs.

The first step in creating a virtual switch is to determine which LAN interface will back the switch. In a non APA configuration the LAN interface will be the normal HP-UX LAN cards e.g. lan0, lan1, etc

In an APA configuration the virtual switch should be backed with the aggregate comprised of the HPUX lan interfaces. An example of an APA interface would be lan900, lan901, etc. For this example we will use a non APA lan interface. However an example of how to create a virtual switch using APA aggregate is also given.

create a vSwitch using aggregate lan900
vparnet -c -S vslan1 -n 900

Start the switch:
vparnet –b –S vslan1

Creating a virtual switch using a non APA aggregatge:

To create a virtual switch named vslan1 backed with LAN interface lan1 use the following syntax
vparnet –c –S vslan1 –n 1 (only the ppa number is used to indicate the lan)

(start the vSwitch)
vparnet -b -S vslan1

Stopping a virtual switch

To stop virtual switch vslan1 use the following syntax:

vparnet –h -S vslan1



In the event that multiple vlans will reside in the same virtual switch the vlan tag may need to be added to the port for that network.

(FOR VLAN TRAFFIC)
1.     Create and start the vswitch. For example, to create and boot vswitch vslan1 on lan1, enter the following command:
# vparnet -c -S vslan1 -n 1
# vparnet -b -S vslan4
4.     Use the vparnet command with the —u option to create the port and assign it a VLAN ID. For example, to create ports 1 and 2 for VLAN 100, enter the following command:
# vparnet -S vslan4 -u portid:1:vlanid:100
# vparnet -S vslan4 -u portid:2:vlanid:100
7.     Add the vswitch ports to the guest configuration using the vparmodify command. For example, to add the new VLAN ports to guests abc and def, enter the following command:
# vparmodify -P abc -a network:avio_lan::vswitch:vslan1:portid:1
# vparmodify -P def -a network:avio_lan::vswitch:vslan1:portid:2





To show vswitch status
vparnet –S vslan1

The  –v optioin will give the verbose output
vparnet –S vslan1 -v

To delete a vswitch from a vpar
vparmodify –p abc -d network:avio_lan::vswitch:vslan1

Notice that the lower case “p” was used in the syntax to refer to the vpar name, and not the capital “P”. In vpar version 6.1 the lower case p is used in all cases to refer to either a vpar name or vpar number. The upper case P is used when renaming a vpar.  You can also use the vpar number to refer to the vpar.


Creating a VPAR

To create the vpar abc with 5 GB of ram, 5 CPU using virtual switch vslan1 as its lan interface, and boot disk disk12 use the following syntax:

vparcreate -p abc –cpu::5  -mem::5G -a network:avio_lan::vswitch:vslan1 -a disk:avio_stor::disk:/dev/rdisk/disk12

To view vpar configuration
vparstatus  –v



MODIFYING A VPAR
Use the vparmodify command to add and remove components to and from the vpar

Below are a few examples of modifications to vpar abc

(add 1 additional cpu)
vparmodify -p abc –a cpu::1

note: adding CPU and memory is not dynamic and the VPAR will need to be stopped to allow the change

(in our example above the vpar was created with 5 cpu. We used a value 0f 1 to add 1 additional cpu to the vpar to give us a total of 6. To remove 1 cpu use the –d on the vparmodify command line as opposed to –a.



(add additional disk)
To add disk 20 to vpar abc use the syntax below:
vparmodify -p abc -a disk:avio_stor::disk:/dev/rdisk/disk20


Add a dvd to a vpar:
Vparmodify –p abc -a dvd::avio_stor::disk:/dev/rdisk/disk32 (disk32 is not a real disk on the Iron Mountain system)

Removing the dvd drive from vpar abc:
vparmodify –p abc -d dvd:avio_stor::disk:/dev/rdisk/disk32

note: The same options for vparcreate are also valid on the vparmodify command line

Labels: