VirtualServer2005とHyper-VをWMIで・・・

仮想マシンの起動とかをリモートからWMIで行おうとしましたが、VirtualServerはちょっと難しいですね。
Hyper-Vなら、「\\[RemoteHostName]\root\virtualization」 名前空間内のクラス「Msvm_ComputerSystem」を使えばOKですが、
VirtualServerだと、
 ・名前空間が「\\[RemoteHostName]\root\vm\virtualserver」であり、Hyper-Vと異なる
 ・その中に「VirtualMachine」というクラスが存在するが、仮想マシンがOFFだと列挙対象外になる。
  (実行中の仮想マシンしか列挙対象にならない)
という感じです。
VBScriptで
  Set objVS = CreateObject("VirtualServer.Application")
  Set colVMs = objVS.VirtualMachines
  For Each objVM in colVMS
   [何か処理]
  Next
とすれば状態がOFFな仮想マシンも列挙対象にはなるのですが、これだとリモートでは制御できないので(T_T)

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny