When you play with vCAC workflow and scripts you will most certainly work with the ManagementModelEntitesClient or the MgmtContext for short. Have a look at my introduction to it in this blog post. But there is actually more in vCAC than just that. Out of the box vCAC ships with these models: And some of them are actually quite useful. […]
Calling PowerShell from vCAC is easy, right. But how about the other way round? Suppose you want to start the ‘ReclaimDestroyedStaticIPAddresses’ or the ‘WFStubMachineExpired’ workflow manually? As usual this can be done via the vCAC MetaModel ODATA REST service and of course with PowerShell. For a brief overview about the MetaModel you can have a look at Investigating vCAC 5.2 […]
When you want to change the owner of a machine in vCAC you would probably like to inform the owner of what he just acquired. The easist thing is to to send an update notification via vCACs VMPS SOAP (ProvisionService) service: You can ignore the error message and wrap it into a try/catch block to hide it. If you get […]
In case you would like to import existing machines into vCAC you have the option to import them via ‘Discovery’ from within the GUI. But if you wanted to import more than a few machines at a time this might become a little more than tedious. Of course you can always revert back to AutoIT or something similar to do […]
We recently had a customer who wanted an automatic approval of machine requests after a specific time span when no other approver would have rejected the request. On the other hand he wanted an automatic rejection of machine requests after a defined idle time for machine types that used large amount of resources (as the resource is still being reserved […]
When provisioning a server via PXE or ISO install you might run into a problem where you see your machines being in an ‘Installing OS’ state (between ‘BuildingMachine’ and ‘MachineProvisioned’) though the actual installation has finished long time ago. This might be because the ‘Guest Agent’ is either not installed on the image/machine or because there is no connectivity between […]
Here is a quick script on how to login to ServiceMesh AgilityPlatform. Never heard of the product? don’t bother. It works nevertheless … Subsequent calls to AgilityPlatform are then execeuted like this (eg list all projects on the platform): An easy way to check if the login session is still valid is to issue the following request: You should receive […]
When you try to convert an ip address string into an [IPAddress] object you might end up with a different address than expected. This can happen if you use the ‘leading zero’ notation for IPv4 addresse (which is not really correct, but easier to sort alphabetically). When you create an [IPAddress] with that kind address style, the constructor does internally […]
As quickly described in a previous post, the ‘AddQueryOption()’ in the vCAC WCF DataService is flawed and does not allow you to narrow queries and thus leads to massive performance penalties when working with larger installations. However, there is a workaround for this: you can use native ODATA REST calls and convert the result into a native .NET vCAC ManagementModelEntities […]
[UPDATE 2014-08-11] See note below for a workaround on this. vCAC provides access to its data model via an ODATA REST interface that is based on the Microsoft .NET Entity Framework. Access to this interface is encapsulated and abstracted via the EF DataService that is exposed via the ModelManagerEntities object. For more information you can check some of my earlier […]
When using the static IP service in vCAC 5.2 you might come to a suprise after you installed vCAC 5.2 Hotfix 4 (HF4), because – it no longer works… VMware Support is informed about this and will fix it in HF5. Until then you either do not use this feature any more or use a workaround to “manually” assign the […]
Today another NoBrainer how you can use PowerShell to do some currency conversions on the fly. The example shown here uses the OANDA(R) currency converter (Note: please read the terms of use if you are entitled to use the API or the web site in a programmatic way.) See Gist at https://gist.github.com/dfch/d5990fdb391fe1b84b76
Sometimes I have to write scripts that are executed interactively and actually watched by operators as they progress – I know this sounds strange enough. In these rare cases I […]
When rolling your own Cmdlets you will probably want to expand your module over time possibly adding or editing functions. I order to keep your Cmdlet as a function and not having to reload the module on every code change you can use Splatting (which requires at least PowerShell v3) to simplify developement and debugging. All you have to do […]
When using https request (directly or indirectly) with PowerShell you might run into different errors when using non-standard (i.e. not trusted, expired, self-signed etc) certificates: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The underlying connection was closed: An unexpected error occurred on a send. In either case you will find plenty of […]
Often you would like to customise one or two things with a script in one of the predefined workflow steps like ‘BuildingMachine’. However depending on your blueprint you do not […]