vCAC: Setting the Status of a Virtual Machine in ‘My Machines’
When you provision a machine in vCAC you will probably integrate with other systems in your infrastructure like IPAM, AD, ITSM and the like. Sometimes this ia a lengthly process. […]
Audit and Consulting of Information Systems and Business Processes
When you provision a machine in vCAC you will probably integrate with other systems in your infrastructure like IPAM, AD, ITSM and the like. Sometimes this ia a lengthly process. […]
When you provision a machine in vCAC you will probably integrate with other systems in your infrastructure like IPAM, AD, ITSM and the like. Sometimes this ia a lengthly process. At that point in time the user already sees his machine in the self service portal but only get a status like ‘MachineProvisioned’. Wouldn’t it be more useful to have a more precise message in that status field? Rhetoric question and the answer is: Actually yes. And it is actually possible by setting the ‘CurrentTask’ property on the VirtualMachine entity:
# $m is the MgmtContext (repository) PS > $m.GetType(); IsPublic IsSerial Name BaseType -------- -------- ---- -------- True False ManagementModelEntities DynamicOps.Repository.RepositoryServiceContext # Grab a VM to set its status PS > $vm = $m.VirtualMachines |? VirtualMachineName -eq 'vc100148'; PS > $vm.CurrentTask = "Under investigation"; PS > $m.UpdateObject($vm); PS > $m.SaveChanges(); Descriptor Headers StatusCode Error ---------- ------- ---------- ----- System.Data.Services.Client.En... {[DataServiceVersion, 1.0;], [... 204 PS > $m.Detach($vm); True
With that code the user will see something like the following in his ‘My Machines’ status field:
A side note: when you are ready with your task you have to remove your ‘CurrentTask’ message. You have to do this as described in my earlier blog post about NullStrings.