PArtial commit Hyper-V 2012 R2 VPS Provider
This commit is contained in:
parent
7ffed2b786
commit
70bd6c5172
2 changed files with 34 additions and 5 deletions
|
@ -137,7 +137,13 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Virtual Machines
|
#region Virtual Machines
|
||||||
|
|
||||||
public VirtualMachine GetVirtualMachine(string vmId)
|
public VirtualMachine GetVirtualMachine(string vmId)
|
||||||
|
{
|
||||||
|
return GetVirtualMachineInternal( vmId, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public VirtualMachine GetVirtualMachineInternal(string vmId, bool extended)
|
||||||
{
|
{
|
||||||
|
|
||||||
HostedSolutionLog.LogStart("GetVirtualMachine");
|
HostedSolutionLog.LogStart("GetVirtualMachine");
|
||||||
|
@ -225,6 +231,13 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
|
|
||||||
public VirtualMachine GetVirtualMachineEx(string vmId)
|
public VirtualMachine GetVirtualMachineEx(string vmId)
|
||||||
{
|
{
|
||||||
|
return GetVirtualMachineInternal( vmId, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public VirtualMachine GetVirtualMachineExInternal(runSpace, string vmId)
|
||||||
|
{
|
||||||
|
|
||||||
ManagementObject objVm = wmi.GetWmiObject("msvm_ComputerSystem", "Name = '{0}'", vmId);
|
ManagementObject objVm = wmi.GetWmiObject("msvm_ComputerSystem", "Name = '{0}'", vmId);
|
||||||
if (objVm == null)
|
if (objVm == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -287,16 +300,18 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
vm.Adapters = nics.ToArray();
|
vm.Adapters = nics.ToArray();
|
||||||
|
|
||||||
return vm;
|
return vm;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
public List<VirtualMachine> GetVirtualMachines()
|
public List<VirtualMachine> GetVirtualMachines()
|
||||||
{
|
{
|
||||||
List<VirtualMachine> vms = new List<VirtualMachine>();
|
List<VirtualMachine> vms = new List<VirtualMachine>();
|
||||||
|
/*
|
||||||
ManagementObjectCollection objVms = wmi.ExecuteWmiQuery("select * from msvm_ComputerSystem where Name <> ElementName");
|
ManagementObjectCollection objVms = wmi.ExecuteWmiQuery("select * from msvm_ComputerSystem where Name <> ElementName");
|
||||||
foreach (ManagementObject objVm in objVms)
|
foreach (ManagementObject objVm in objVms)
|
||||||
vms.Add(CreateVirtualMachineFromWmiObject(objVm));
|
vms.Add(CreateVirtualMachineFromWmiObject(objVm));
|
||||||
|
*/
|
||||||
return vms;
|
return vms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2029,10 +2044,10 @@ exit", Convert.ToInt32(objDisk["Index"])));
|
||||||
|
|
||||||
#region Stop
|
#region Stop
|
||||||
else if (!started &&
|
else if (!started &&
|
||||||
(vps.State == VirtualMachineState.Started
|
(vps.State == VirtualMachineState.Running
|
||||||
|| vps.State == VirtualMachineState.Paused))
|
|| vps.State == VirtualMachineState.Paused))
|
||||||
{
|
{
|
||||||
if (vps.State == VirtualMachineState.Started)
|
if (vps.State == VirtualMachineState.Running)
|
||||||
{
|
{
|
||||||
// try to shutdown the system
|
// try to shutdown the system
|
||||||
ReturnCode code = ShutDownVirtualMachine(vm.VirtualMachineId, true, "Virtual Machine has been suspended from WebsitePanel");
|
ReturnCode code = ShutDownVirtualMachine(vm.VirtualMachineId, true, "Virtual Machine has been suspended from WebsitePanel");
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 2012
|
# Visual Studio 2013
|
||||||
|
VisualStudioVersion = 12.0.30723.0
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching Application Block", "Caching Application Block", "{C8E6F2E4-A5B8-486A-A56E-92D864524682}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching Application Block", "Caching Application Block", "{C8E6F2E4-A5B8-486A-A56E-92D864524682}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
Bin\Microsoft.Practices.EnterpriseLibrary.Common.dll = Bin\Microsoft.Practices.EnterpriseLibrary.Common.dll
|
Bin\Microsoft.Practices.EnterpriseLibrary.Common.dll = Bin\Microsoft.Practices.EnterpriseLibrary.Common.dll
|
||||||
|
@ -152,6 +154,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Host
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Mail.IceWarp", "WebsitePanel.Providers.Mail.IceWarp\WebsitePanel.Providers.Mail.IceWarp.csproj", "{95EA2D6E-278C-4A74-97DB-946362C4DEEA}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Mail.IceWarp", "WebsitePanel.Providers.Mail.IceWarp\WebsitePanel.Providers.Mail.IceWarp.csproj", "{95EA2D6E-278C-4A74-97DB-946362C4DEEA}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Virtualization.HyperV2012R2", "WebsitePanel.Providers.Virtualization.HyperV-2012R2\WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj", "{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -772,6 +776,16 @@ Global
|
||||||
{95EA2D6E-278C-4A74-97DB-946362C4DEEA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
{95EA2D6E-278C-4A74-97DB-946362C4DEEA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
{95EA2D6E-278C-4A74-97DB-946362C4DEEA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
{95EA2D6E-278C-4A74-97DB-946362C4DEEA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
{95EA2D6E-278C-4A74-97DB-946362C4DEEA}.Release|x86.ActiveCfg = Release|Any CPU
|
{95EA2D6E-278C-4A74-97DB-946362C4DEEA}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||||
|
{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||||
|
{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
|
{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
|
{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue