With PowerCLI’s ConnectCI-Server CmdLet it is pretty easy to login to a vCD host. And for most of the time the supplied CmdLets are sufficient enough to solve the problems we deal with it daily. However, sometimes we would like to make specific REST calls to vCD directly (for example when the Searc-Cloud CmdLet is not doing what we want). […]
In certain cases you might want to access a UNC share from a VCO instance. This is especially true when you have a mainly Windows based environment with more than one VCO instance. In addition it comes in handy when you implement the VCO Powershell Bridge I presented earlier. First you have to run the VCO service under a service […]
In vCloud API (via REST, vCO PlugIn, or PowerCLI) you can query CPU, memory and disk usage for VDCs. However, when retrieving the values for current CPU usage you always get ‘0’ – regardless of real current usage. Values for memory and storage seem correct. There is a workaround for this via querying the underlying vCenter resource pool for that […]
With PowerCLI for vCD and vCenter it is particularily easy to determine the underlying vCenter resource pool for any vCloud Organization VDC. You first retrieve the resource pool relation via the Search-Cloud CmdLet via the urn of the VDC and then use the Get-ResourcePool CmdLet to get the actual resource pool (via Typed Queries): done.
Along with the CmdLets in “VMware.VimAutomation.Cloud” you will find a CmdLet that is called “Search-Cloud”. In fact this is one of the most powerful CmdLets in ypur arsenal of vCD CmdLet tools. It is especially useful as it uses the new Query Service of vCD and is thus much faster than the other traditional Get-* CmdLets. The tradeoff is that […]
With the advent of PowerCLI for vCloud Director the reasons for using vCenter Orchestrator (vCO) blur even more. VMware provides us several CmdLets that we can all find in the “VMware.VimAutomation.Cloud” snapin (“Get-Command -Module VMware.VimAutomation.Cloud”). Sure this library is by far not perfect, there is quite some functionality. However, when using the “Get-CiVm” CmdLet you will probably find out quickly […]
The new powershell feature “ordered” hashtable (a new PowerShell feature in v3. See OrderedDictionary Class) becomes an ordinary hashtable when it is imported via Import-CliXml. There is a “active” bug on Microsoft Connect OrderedDictionary becomes Hashtable when exported to and imported from clixml but no action for a couple of months. As a workaround do not use ordered hashtables but […]
Here a few coding considerations that might make you life easer when dealing with PowerShell (but may also hold true for other programming languages): Hide unwanted return information in your code In PowerShell your functions and CmdLets return everything that is output within the function – even if you use an explicit return statement. To avoid unwanted returns from there […]
Microsoft PowerShell allows us to create, read and write performance counters via .NET with ease (check PerformanceCounterCategory in System.Diagnostics). However, there are some gotchas when trying it the first time …