Davoud Teimouri

Virtualization & Datacenter

[Script]: Enable/Disable vMotion on VMKernel Ports via PowerCLI

Enabling vMotion on VMKernel Ports via PowerCLI

You maybe have to disable or enable vMotion traffic on some VMKernel ports on ESXi for doing some maintenance tasks. Disabling or enabling takes lot of time for many servers in datacenter. You can disable or enable vMotion via PowerCLI by run a simple script.

The below script will enable vMtion for all ESXi hosts on a vCenter:

Note: Change “VMKernel Port Name” with specific VMKernel port on your ESXi servers. Change “$true” to “$false” for disabling vMotion.

You can find VMKernel ports for specific ESXi hosts or all the ESXi hosts with the below scripts:

Note: Remove “Host Name or Host IP” to list all ESXi servers’ VMKernel ports.

If you want to disable or enable vMotion on ESXi hosts within cluster, you can use the below script:

Note: Change Cluster1 with your cluster name and also if you want disabling vMotion, replace $true with $false.

More on Teimouri.Net

Java.net.SocketException: No buffer space available – VMware View Connection Server

Update VMware Tools Automatically

ESXi Command-Line – Part 1

Run ESXi Commands Via PowerShell And SSH

[Script]: Check Time Synchronization with Host on Virtual Machines – PowerCLI

[PowerCLI]: Add Local Administrator Account on ESXi

[PowerCLI]: ESXi Syslog Configuration via PowerCLI

[How To]: ESXi Installation Stopped – partedUtil Failed

[Script]: Find ESXi HBA WWN via PowerCLI

3,417 total views, 1 views today

[Script]: Enable/Disable vMotion on VMKernel Ports via PowerCLI
5 (100%) 2 Votes

Davoud Teimouri is as a professional blogger, vExpert 2015/2016/2017/2018, VCA, MCITP. This blog is started with simple posts and now, it has large following readers.

Leave a Reply

Your email address will not be published. Required fields are marked *

Teimouri.net © 2012 Frontier Theme
Read previous post:
PowerCLI
[Script]: Check Time Synchronization with Host on Virtual Machines – PowerCLI

How to Check Time Synchronization with Host on Virtual Machines via PowerCLI As you know, virtual machines can sync their...

Close