diff --git a/WebsitePanel.VmConfig/Sources/WebsitePanel.VmConfig.Common/SetupNetworkAdapterModule.cs b/WebsitePanel.VmConfig/Sources/WebsitePanel.VmConfig.Common/SetupNetworkAdapterModule.cs index f89e0ccc..10368789 100644 --- a/WebsitePanel.VmConfig/Sources/WebsitePanel.VmConfig.Common/SetupNetworkAdapterModule.cs +++ b/WebsitePanel.VmConfig/Sources/WebsitePanel.VmConfig.Common/SetupNetworkAdapterModule.cs @@ -91,7 +91,7 @@ namespace WebsitePanel.VmConfig } attempts++; - Log.WriteError(string.Format("Attempt #{0} to find network adapter failed!", attempts)); + Log.WriteError(string.Format("Attempt #{0} to find network adapter (mac: {1}) failed!", attempts, macAddress)); // wait 1 min System.Threading.Thread.Sleep(60000); //repeat loop diff --git a/WebsitePanel.VmConfig/Sources/WebsitePanel.VmConfig/App.config b/WebsitePanel.VmConfig/Sources/WebsitePanel.VmConfig/App.config index 91660b84..02e7119e 100644 --- a/WebsitePanel.VmConfig/Sources/WebsitePanel.VmConfig/App.config +++ b/WebsitePanel.VmConfig/Sources/WebsitePanel.VmConfig/App.config @@ -6,7 +6,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs index e36bf665..6670be2b 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Virtualization.HyperV-2012R2/HyperV2012R2.cs @@ -228,21 +228,31 @@ namespace WebsitePanel.Providers.Virtualization try { - Command cmd = new Command("Get-VM"); + HostedSolutionLog.LogInfo("Before Get-VM command"); + Command cmd = new Command("Get-VM"); Collection result = PowerShell.Execute(cmd, true); + + HostedSolutionLog.LogInfo("After Get-VM command"); foreach (PSObject current in result) { - VirtualMachine vm = new VirtualMachine - { - VirtualMachineId = current.GetProperty("Id").ToString(), - Name = current.GetString("Name"), - State = current.GetEnum("State"), - Uptime = Convert.ToInt64(current.GetProperty("UpTime").TotalMilliseconds), - ReplicationState = current.GetEnum("ReplicationState") - }; + HostedSolutionLog.LogInfo("- start VM -"); + var vm = new VirtualMachine(); + HostedSolutionLog.LogInfo("create"); + vm.VirtualMachineId = current.GetProperty("Id").ToString(); + HostedSolutionLog.LogInfo("VirtualMachineId {0}", vm.VirtualMachineId); + vm.Name = current.GetString("Name"); + HostedSolutionLog.LogInfo("Name {0}", vm.Name); + vm.State = current.GetEnum("State"); + HostedSolutionLog.LogInfo("State {0}", vm.State); + vm.Uptime = Convert.ToInt64(current.GetProperty("UpTime").TotalMilliseconds); + HostedSolutionLog.LogInfo("Uptime {0}", vm.Uptime); + vm.ReplicationState = current.GetEnum("ReplicationState"); + HostedSolutionLog.LogInfo("ReplicationState {0}", vm.ReplicationState); vmachines.Add(vm); + HostedSolutionLog.LogInfo("- end VM -"); } + HostedSolutionLog.LogInfo("Finish"); } catch (Exception ex) {