From 36103633c2764fe33374f5cbfb1ac0d5bf24ed1b Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Sun, 13 Apr 2014 23:29:20 -0700 Subject: [PATCH] CLOUDSTACK-6398:[hyper-v] changed auto shutdown and startup actions of VMs to shutdown and nothingauto shutdown and startup actions of VMs to shutdown and nothing so that they are consistent with cloudstack auto shudown and startup behavior --- .../DotNet/ServerResource/HypervResource/WmiCallsV2.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs index 79fd0bcace0..c10aaa3d013 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs @@ -1744,9 +1744,12 @@ namespace HypervResource { // Tweak default settings by basing new VM on default global setting object // with designed display name. - + UInt16 startupAction = 2; // Do nothing. + UInt16 stopAction = 4; // Shutdown. VirtualSystemSettingData vs_gs_data = VirtualSystemSettingData.CreateInstance(); vs_gs_data.LateBoundObject["ElementName"] = name; + vs_gs_data.LateBoundObject["AutomaticStartupAction"] = startupAction.ToString(); + vs_gs_data.LateBoundObject["AutomaticShutdownAction"] = stopAction.ToString(); System.Management.ManagementPath jobPath; System.Management.ManagementPath defined_sys;