Update all Host profiles from reference host script


WhatsAppTumblrEmailGoogle BookmarksPrint

Enable / Disable alerts on ESXi Cluster script


WhatsAppTumblrEmailGoogle BookmarksPrint

Configure all vDS port groups as Elastic script – vSphere 6.0 (vds 5/5.5)

Tested on vSphere 6.0u1 vDS 5 and 5.5, Nov 2016

WhatsAppTumblrEmailGoogle BookmarksPrint

vBlock upgrade: Cisco Nexus 1000v VSM upgrade guide – example target version 5.2(1)SV3(1.5a)

Cisco Nexus 1000v VSM upgrade

1.Download the necessary files from VCE portal based on your target RCM

2.Verify all the prerequisites on Cisco documentation:

(here’s the example for version we are upgrading to 5.2(1)SV3(1.5a)

3.Make sure there is sufficient space on active and standby VSM:

Log into active VSM
check active VSM disk space:
check the standby VSM disk space
– If needed delete old files using ‘delete’ command (always leave the current VSM version files just in case for the restore)
– repeat the same for standby VSM:

4.Copy the files onto active VSM.
In order to transfer the files, log onto active VSM and run:
– copy those onto the standby VSM

5.Copy running configuration to startup configuration

6.Power off standby VSM and clone to template:
After that power on the standby VSM and wait until it comes back up.

7.Backup and pre-checks
Log onto active VSM.
Copy running configuration to startup configuration:
Run pre-checks:
Looking above we can see that the impact state is non-disruptive, we can verify the current and new version as well as ESXi compatibility.
It’s crucial that ESX hosts are compatible at this stage as the VEMs are not upgraded yet.

8.Verify Cisco VSG is not present in configuration

9.Begin the install
This will show the pre-checks table again and will prompt if you would like to take a backup. Select N (if you select Y, the installer will quiet and the backups are to be taken manually via scp commands as done in step 7)
The installer will hang on “Switching over onto standby” : (SSH session may timeout here, it’s OK!)
At this point wait few minutes and log-in to VSM (which is the standby VSM which has now became the active VSM)
Once logged in run:

10. Post-Installation checks
Run show version command on both active and standby VSM:

This should return the target version in our case 5.2(1)SV3(1.5a)

Copy running configuration to startup configuration (IMPORTANT)

Upgrade completed!
WhatsAppTumblrEmailGoogle BookmarksPrint

vSphere 6u2 permissions vs perl SDK API calls.

Prior to upgrading to vSphere 6  (running 5.5) my user account had a read-only privileges on the vSphere object, Datacenter object, as well as some grater rights on clusters, vDS and datastore.

Using Perl SDK to deploy new VM’s – vmcreate.pl worked fine.

PowerCLI C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\apps\vm> perl .\vmcreate.pl –url https://vCenterServer.local:443/sdk/webService –filename C:\Sc
ripts\XMLVM.xml –schema C:\Scripts\Schema.xsd –username ad\test
Enter password:

Successfully deployed the VM. 

After the upgrade to vSphere 6u2 each time the script was run, it returned an error:

Moreover the VM could be easily created in that cluster / datastore etc using both Web Client and C#.


After ripping permissions top to bottom and bottom to top it looks like for some reason it requires administrator privileges on the data center object.

I’ve tried to narrow it down and create the custom role  (focusing on Inventory and Virtual machine privileges ) however there are some further issues.

C# client and API would work, but I was unable to deploy VM manually in the web client… ?!?

Leaving this permission as administrator on data center object non-propagating looks to do the job for now.

I’ll keep this post updated if I find time to drill down into it further.

WhatsAppTumblrEmailGoogle BookmarksPrint

vCloud Director RESTapi using powershell to disable org,orgvdc and poweroff vApps

Script written to automate vCD cancellation process using powershell and REST.

It takes vcd and organization as input and cancel that customer in multi tenant environments. By cancel I mean disable org,orgvcd and power off all existing vApps.

Any questions let me know!



WhatsAppTumblrEmailGoogle BookmarksPrint

Powershell & SSH-Module – automated ssh/sshd configuration changes for multiple nodes

This script uses powershell ssh module and provides a quick way for global configuration changes if puppet/chef etc is not available in your environment. Below is an example of ssh/sshd changes. Moreover using invoke-sshcommand can perform any  action / pass parameters to the shell.


WhatsAppTumblrEmailGoogle BookmarksPrint

Powershell,ovftool & powercli unattended deployment Tips

Typical vCC deployment command syntax is:

Here’s how to obtain some of those parameters (PowerCLI):

Get host from specific cluster:

Get datastore with most free space for specific cluster:

Get network with specific content/prefix:

Have fun!

WhatsAppTumblrEmailGoogle BookmarksPrint

ovftool syntax and escaping special characters

Came across an issue (what are the odds for that ?) where my password did not go along with ovftool syntax.

The syntax is vi://username:password@vcserveraddress

You could see having @ is a problem, as well as ad account having ‘ad\’ , found this blog by Steve Flanders which allow me to bypass this issue


Modified script in order to escape the special characters:

OLD script (doesn’t work)


Modified script (excluding LDAP part which remains the same):

Hope it helps.

WhatsAppTumblrEmailGoogle BookmarksPrint

Automated deployment of vCC Server/Node on biggest datastore/dmz network/LDAP auth using powershell and powerCLI

EDIT – Struggling with VAMI property key does not exist, here’s the workaround. Let the VM boot without applying network settings and use PowerCLI – Invoke-VMScript


Datastore calculations found on http://www.spug.co.uk/?p=185 @Thanks!

Also William Lam’s post http://www.virtuallyghetto.com/2011/11/unattended-deployment-of-vcloud.html – Thanks!

WhatsAppTumblrEmailGoogle BookmarksPrint