mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fixing rebase issues after integrating with wmi v2 implementation. Removing the executable attribute from some files. Remove the unused wmi v1 interface file. Unit test for DestroyCommand implementation in hyperv agent. Fixed VM state changes w.r.t wmi version 2 changes If a VM is already running, deploy virtual machine shouldn't fail and throw an exception. Don't run vhd-util on templates which are present on CIFS. Hyperv uses cifs as secondary storage Add a SCSI controller by default. This is needed so that data volumes can be added/removed on a running vm. Remove the hard coded path in the agent code. Rat fixes for hyper agent. Added the missing headers in files where it was missing.
Classes were generated on a hyper-v server using the Visual Studio GUI, but you can do the same using mgmtclassgen.exe. Below are some examples: mgmtclassgen.exe Msvm_ComputerSystem /N root\virtualization /L CS /O CloudStack.Plugin.WmiWrappers /P ComputerSystem.cs mgmtclassgen.exe Msvm_VirtualSystemManagementService /N root\virtualization /L CS /O CloudStack.Plugin.WmiWrappers /P VirtualSystemManagementService.cs mgmtclassgen.exe Msvm_VirtualSystemGlobalSettingData /N root\virtualization /L CS /O CloudStack.Plugin.WmiWrappers /P VirtualSystemGlobalSettingData.cs BUT, you have to tweak the generated code, because it does not deal with NULL method parameters properly. E.g. when a method completes immediately, the returned out parameters include a "Job" property that has a NULL value. The generated code will attempt to call ToString() on this NULL value. ALSO, you have to tweak the generated code to expose useful details such as the WMI name for the class. E.g. the generated code creates a wrapper called class ComputerSystem for WMI objects of class Msvm_ComputerSystem. Thus, there is a mismatch in the class name and the corresponding WMI class, and the WMI class name is a private constant static member. The tweak involves making this member public.