Merk
Tilgang til denne siden krever autorisasjon. Du kan prøve å logge på eller endre kataloger.
Tilgang til denne siden krever autorisasjon. Du kan prøve å endre kataloger.
Whenever Virtual Server has a task to complete (like merging a hard disk) that may take a while - it creates a task object. You have probably seen these used in some of my scripts when I want to wait for a task to complete before moving onto the next step. These task objects are really quite useful - and expose some interesting information.
The script below will retrieve all active task object from a Virtual Server instance - and then display the Task ID, description and percentage completion:
Set vs = CreateObject("VirtualServer.Application")
Set tasks = vs.Tasks
If tasks.Count = 0 Then
Wscript.Echo "There are no tasks"
Else
Wscript.Echo "Active tasks: "
For Each task in tasks
Wscript.Echo " Task: " & task.ID & " : " & task.Description & " : " & task.PercentCompleted
Next
End If
Cheers,
Ben
Comments
- Anonymous
March 23, 2006
So, is the main purpose of a task object to give you the ability to either programmatically wait for the task to complete (i.e. serial) or to move on to some other activity (i.e. parallel)?
Something like "start notepad" and "start /wait notepad" ? - Anonymous
March 23, 2006
The comment has been removed - Anonymous
March 23, 2006
David: Thank you for your answer, as well as the references to your articles. - Anonymous
March 24, 2006
Thanks for all the info on the "API of Virtual Server". Makes me wonder, though ... I see an opportunity for someone to make an overall GUI to manage VS that would include stuff that there are API's for that the web site does not expose today. VMWare has VirtualCentre that is a competitive advantage. Any MS plans for this? Or leaving it for 3rd party? - Anonymous
March 24, 2006
James - No, the website pretty much exposes the entire API and has a machine-centric view. There are no special API calls to make "VirtualCenter" that is not exposed.
What you are talking about is a Product that utilizes the same APIs in a different manner to produce a different concept (merge multiple machines into a logical view) that is suitable for other usage models.
This is why Microsoft provides an API - so that anyone can do what they need, stand on the shoulders of giants, and exploit any business opportunities.
Microsoft is a platform company that fosters and depends on a thriving 3rd party development community to make its platform attractive and successful.
Products like Virtual Center can easily be built on the Virtual Server Administration API. Someone just has to do it. And it shouldn't be Microsoft by default. For example, I've got designs to do this from just a commandline application, but I should not be the only choice in town.
Think about it another way - for VMWare, there is only one source for advancements in the technology/feature set - VMWare itself. For Virtual Server, with a public API, there is Microsoft and any 3rd party developer in the same space. Which model do you think long-term innovation and scalability will reside?
But when the customer assumes that Microsoft should do everything -- that's when it all can fail.
//David