Browsed by
Tag: scripts

Part 2 – How to list vSwitch “MAC Address table” on ESXi host?

Part 2 – How to list vSwitch “MAC Address table” on ESXi host?

The other way to list MAC addresses of open ports on vSwitches on the ESXi host is based on net-stats tool. Use this one-liner. for VSWITCH in $(vsish -e ls /net/portsets/ | cut -c 1-8); do net-stats -S $VSWITCH | grep \{\”name | sed ‘s/[{,”]//g’ | awk ‘{$9=$10=$11=$12=””; print $0}’; done This is not a final word. 🙂

0 Shares
Part 1 – How to list vSwitch “MAC Address table” on ESXi host?

Part 1 – How to list vSwitch “MAC Address table” on ESXi host?

Sometimes You need to list MAC addresses loged on host’s vSwitches to eliminate VM’s MAC address duplicates. Create a shell script: vi mac_address_list.sh Copy and past the code listed below: #!/bin/sh #vmrale for VSWITCH in `vsish -e ls /net/portsets/ | cut -c 1-8` do echo $VSWITCH for PORT in `vsish -e ls /net/portsets/$VSWITCH/ports | cut -c 1-8` do CLIENT_NAME=`vsish -e get /net/portsets/$VSWITCH/ports/$PORT/status | grep clientName | uniq` ADDRESS=`vsish -e get /net/portsets/$VSWITCH/ports/$PORT/status | grep unicastAdd | uniq` echo -e “\t$PORT\t$CLIENT_NAME\t$ADDRESS” done…

Read More Read More

0 Shares
Alternative methods to create virtual switch.

Alternative methods to create virtual switch.

Creating virtual switch through GUI is well described in documentation and pretty intuitive using GUI. However, sometimes it might be useful to know how to do it with CLI or Powershell, thus making the process part of a script to automate initial configuration of ESXi after installation. Here you will find commands which are necessary to create and configure a standard virtual switch using CLI and Powershell. Those examples will describe the process of vSwitch creation for vMotion traffic which involves VMkernel…

Read More Read More

0 Shares
PowerCLI – useful tools

PowerCLI – useful tools

VMware PowerCLI is a powerful tool for daily task for every Admin. The pure console is most commonly used. However, there are a few alternatives to the simple console which could make the use of PowerCLI even more handy. I’ll describe them shortly in the next a few lines. Powershell ISE script editor, which provides a better user experience. It’s divided into two panes. The upper pane  is for viewing/editing script files, and the lower pane is for running individual commands…

Read More Read More

0 Shares
PowerCLI course

PowerCLI course

I was always keen on getting deeper knowledge about PowerCLI or in other words – start to use it in daily administrative tasks. I decided to do something with it and I think it would be the best way to write my own guide in a form of structured notes and share it here with you. Perhaps someone would find it useful. Therefore in PowerCLI & VMA tab you could find an agenda of this course which will be systematically…

Read More Read More

0 Shares