Perl Toolkit: pNIC to vSwitch information

Another itch to scratch: which vSwitch is a pNIC connected to? To solve this simple problem I created a quick perl script…

This script also lets me see the driver in use, connection speed and duplex setting, and the MAC address of the pNIC.

# Sample output:
Adaptor (Driver)        Speed (Duplex)          MAC                     vSwitch
----------------        --------------          ---                     -------
vmnic1 (bnx2)           1000 (Full)             00:00:00:00:00:00       vSwitch0
vmnic0 (tg3)            1000 (Full)             00:00:00:00:00:00       vSwitch0
vmnic3 (tg3)            1000 (Full)             00:00:00:00:00:00       vSwitch1
vmnic2 (bnx2)           1000 (Full)             00:00:00:00:00:00       vSwitch1

Continue Reading »

ESX
Perl
Scripting
VMware
vCenter

Comments (5)

Permalink

Perl Toolkit: Portgroup type information

I wanted get a list of port groups and their type (kernel, console, virtual machine) from a series of hosts, however the only thing I could find that was even close was a POSH script in the VMTN forums that was posted by LucD.

Using that script for inspiration, I essentially duplicated the functionality, but using the perl toolkit. This script gives me an easy to read (and parse…) list of portgroups, the vSwitch they belong to, and the type.

Continue Reading »

ESX
Perl
Scripting
VMware
vCenter

Comments (0)

Permalink

vMotion configuration from the ESX host command line and remotely using the Perl Toolkit

One of the things that I do when configuring my hosts after kickstart is setup a kernel interface and enable vMotion for that port group. This isn’t too difficult, but takes a little bit of futzing with some vmware-vim-cmd results to get the data we need.

Since I’m on the subject, I figured I may as well do the same thing using the SDK, which eliminates one more thing that the rCLI can’t do in order for me to configure a new ESX host completely.

Continue Reading »

ESX
Perl
VMware

Comments (0)

Permalink

Adjusting Console OS RAM via rCLI

In order to facilitate my ability to configure all aspects of an ESX host automatically, I wanted to adjust the amount of memory that is assigned to the COS without having to use VI Client. The perl below is the result of that effort.

As always, I am not responsible for any damage caused to your infrastructure, I recommend you put your host in maintenance mode and move all VMs off of it before attempting any significant action upon it (there should be little risk involved with this script though…). The change will not take effect until you reboot the host (which can be accomplished with the hostops.pl sample script provided as a part of the Perl Toolkit).

Continue Reading »

ESX
Perl
VMware

Comments (1)

Permalink