1

I want to monitor the states of VM created using Hyper-V/SCVMM using the Java code. I have read that for Hyper-V i need to use J-Interop to acess the API of Hyper-V. Does SCVMM also provides API to get the basic information of VM ? If yes then is there any documentation to access it via Java.

Thanks in advance.

SANN3
  • 9,459
  • 6
  • 61
  • 97
C Deepak
  • 1,258
  • 1
  • 17
  • 23
  • Do you want in Java only? I know there are some java libraries available but they are not reliable. I have tried but most them lacks many feature and are buggy. I have done in python and VB ! – Reuben Jan 23 '14 at 13:40
  • Yes i want it in Java only. PowerShell seems the only option for now. Please share the link/name of java library. Ill see how much useful are they. – C Deepak Jan 23 '14 at 14:22

2 Answers2

0

I had posted same question on Microsoft forum and got following answer.

THE SCVMM API is PowerShell. Unless you want to also install Service Provider Foundation (SPF) in front for a web service.

http://social.technet.microsoft.com/Forums/systemcenter/en-US/8545d105-bc46-46e8-83d1-704c477d4915/are-there-any-apis-exposed-for-scvmm-2012-which-can-be-accessed-via-java?forum=virtualmachinemanager#8545d105-bc46-46e8-83d1-704c477d4915

Following link are helpful :
http://social.technet.microsoft.com/Forums/scriptcenter/en-US/d32537bd-0aef-440e-8760-6b3085390c37/executing-powershell-script-via-java?forum=winserverpowershell

Invoke Powershell scripts from Java

Community
  • 1
  • 1
C Deepak
  • 1,258
  • 1
  • 17
  • 23
0

In reply of the comment "Hi Reuben. SCVMM 2007 onward the only API provided is Power Shell and not WMI. Please refer : social.technet.microsoft.com/Forums/systemcenter/en-US/… "

Couldn't add this much long comment so posting it in Answer:

Saw the link and as usual the guy David has not answered the last question.

I have worked on Hyper-V 2,3 on both WinServer 2k8 & 2012 and we have used WMI. I couldn't agree with the comment, "The public interfaces for SCVMM 2007 and SCVMM 2008 are all PowerShell. There are no WMI interfaces. "

Read this msdn link: http://msdn.microsoft.com/en-us/library/ee309377(v=vs.85).aspx

They have written that , "Windows PowerShell provides a simple mechanism to connect to Windows Management Instrumentation (WMI) on a remote computer"

So If I can directly acces WMI using j-interop or j-integra then why do I need powershell ?

Just Read about WMI in wiki.

Any how its up to you , how you wanna develop. But What I think is its an extra work and extra process you are gonna trigger.

Reuben
  • 5,556
  • 10
  • 43
  • 55
  • Thanks for the explanation Reuben. I will try and let you know how it goes. I hope you have live ID. You can add same comment there also. It would be great help for all. – C Deepak Jan 27 '14 at 11:14
  • Yeah sure I will ask them ! – Reuben Jan 27 '14 at 11:23
  • 1
    I just checked the documentation of SCVMM 2012 here http://technet.microsoft.com/en-us/library/gg610610.aspx The only reference for API i found was for powershell cmdlets and there is no documentation provided for WMI. For Hyper-V .. yes .. WMI documentation is provided. But for SCVMM ... no .. WMI documentation not provided. Only powershell documentation provided. Please check and let me know if i missed anything. – C Deepak Jan 27 '14 at 11:38
  • 1
    oh my gosh !!! Extremely my fault , Unintentionally writing every posts I assumed Hyper-V . Deleting my other posts. Thank you very much for this good discussion and +5 for your research and hard work. But again, executing powershell from java will be poor in efficiency ! – Reuben Jan 27 '14 at 13:50
  • np :) ... I know executing PowerShell from Java is bad idea but Microsoft have not provided any other choice. And yes .. good discussion :) – C Deepak Jan 27 '14 at 13:55