RSS

Category Archives: vmware

vSphere: A colorful DCUI welcome screen

I was tasked to make our ESXi hosts compliant to the security standards and one of them is to set the legal message on DCUI. The work is easy enough, however you end up with only a black screen with the legal text and it looks very ugly!

So I chanced upon two links which shows you how you can add colors and format to the welcome message. Unfortunately, none of them shows you how to get it right.

Read the rest of this entry »
Advertisements
 
Leave a comment

Posted by on March 15, 2019 in powershell, Scripts, vmware

 

Tags: ,

PS: How to get ESXi multipath storage with Powerpath

If your vSphere’s ESXi hosts are connected to storage via EMC’s powerpath, the convention methods of querying path info will not work. Basically, you will get zero results.

For example when you query the lun via MultipathInfo you may only see iSCSI luns listed (if you have them running), but not your datastores. Read the rest of this entry »

 
Leave a comment

Posted by on August 21, 2018 in powershell, vmware

 

PS: Getting a virtual machine’s properties in vRA

Getting the properties of a VM provisioned in vRA is not straight forward, you need to get those information from the IaaS Web server instead of from vRA

This site shows you how you can get to it.

I am not sure which version the author has, but in version 7.2 the properties are not so straight forward and they strangely don’t expand when exported to a JSON file. However let’s first deal with the NTLM authentication on IaaS Web via a Invoke-RestMethod call. Its actually very straight forward, but hard to find; simply speaking, you use get-credential to capture the windows credentials and input it with -credential parameter. Read the rest of this entry »

 
Leave a comment

Posted by on August 2, 2018 in powershell, vmware

 

Tags: ,

PS: Adding nodes to JSON object

Whilst working on vRA REST API to provision new virtual machines, one of task was to get the template for that catalog item and fill in required values.

One of the values common to most templates is the datacenter_location value. By default it will be null. That is not a big deal if you don’t care which datacenter your VM is being provisioned to, but what if you want to specify a location?

...
"_cluster": 1,
"_hasChildren": false,
"cpu": 1,
"datacenter_location":  null,
...

In this case the values should be as such

 "_cluster": 1,
"_hasChildren": false,
"cpu": 1,
"datacenter_location": {
               "classId": "Infrastructure.Compute.DataCenterLocations",
               "id": "DC1"
            },

This is how you can add the values into the JSON object (I am assuming that you already gotten the bearer token in the $vratoken variable) Read the rest of this entry »

 
Leave a comment

Posted by on August 2, 2018 in powershell, vmware

 

Tags: , ,

PS+REST:NSX Central CLI using REST API

As a second part from my previous post, I modified the script to run Central CLI. One thing to note, you need to add “accept”=”text/plain” into the header when running central CLI command or you will get 406 errors (sorry, I found this out in one of the blogs, but couldn’t give the proper credits).

Lastly the request returns a bunch of text and not XML or JSON.

nsxoutput

Read the rest of this entry »

 
Leave a comment

Posted by on February 15, 2018 in powershell, vmware

 

Tags: , , ,

PS+REST: ESXi hosts’ NSX Channel Health check

As part of the daily checks for NSX, we need to ensure that the communication channel on all ESXi hosts are healthy.

The REST API for channel health is straight forward, just feed the list of host IDs into the API and query the hostConnStatus for the XML file. Read the rest of this entry »

 
Leave a comment

Posted by on February 15, 2018 in powershell, vmware

 

Tags: , ,

vSphere: Transparent page sharing revisited

Recently, some of the clusters were under memory pressure and we had to consider turning on TPS to elevate memory pressure. Now in an ideal setting, you never need to do that because upper management always makes intelligent decisions and ensures that new VM demands are always met with at least 80% capacity. Also TPS, no matter how effeciency, essentially takes up CPU cycles. Of course, back in the real world demand always excess the capacity you have. Read the rest of this entry »

 
Leave a comment

Posted by on February 5, 2018 in vmware

 

Tags: ,