WMI calls for virtualization - not returning values.

S

Shreya Govind

Hi,
I am using WMI calls to ge the Virtual system information of a VM on
Hyper-V using Ruby.
Below is my code:


require 'pp'
require 'win32ole'
wmi = WIN32OLE.connect("winmgmts://./root/virtualization")

processes = wmi.ExecQuery("select * from
MsVM_virtualSystemManagementService")
temp = nil
result = Array.new
input = nil

for process in processes do
pp process.Caption
pp process.Name
pp ret = process.GetSummaryInformation(input,
[0,1,2,3,4,100,101,102,103,104,105,106,107,108],
result)
end
pp result

ret is 0. which is for success. But 'result' is empty. Iam know that Iam
missing out something. Please do let me know how to make this work. Iam
stuck here.

Thanks in Advance,
Shreya
 
G

Gordon Thiesfeld

[Note: parts of this message were removed to make it a legal post.]

On Mon, Jul 13, 2009 at 3:20 AM, Shreya Govind <
Hi,
I am using WMI calls to ge the Virtual system information of a VM on
Hyper-V using Ruby.
Below is my code:


require 'pp'
require 'win32ole'
wmi = WIN32OLE.connect("winmgmts://./root/virtualization")

processes = wmi.ExecQuery("select * from
MsVM_virtualSystemManagementService")
temp = nil
result = Array.new
input = nil

for process in processes do
pp process.Caption
pp process.Name
pp ret = process.GetSummaryInformation(input,
[0,1,2,3,4,100,101,102,103,104,105,106,107,108],
result)
end
pp result

ret is 0. which is for success. But 'result' is empty. Iam know that Iam
missing out something. Please do let me know how to make this work. Iam
stuck here.

Check WIN32OLE::ARGV for the result. This is explained here:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/169830
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top