cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devd...@apache.org
Subject [31/54] git commit: updated refs/heads/hyperv to a27899a
Date Mon, 28 Oct 2013 06:04:57 GMT
A plugin for Hyper-V control is available for CloudStack.  The plugin implements basic VM control;  however, its
architecture allows additional functionality to be easily added.  Incorporating the plugin in CloudStack will allow
the community to participate in improving the features available with Hyper-V.

The plugin uses a Director Connect Agent architecture described here: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Progress


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1d0a931d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1d0a931d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1d0a931d

Branch: refs/heads/hyperv
Commit: 1d0a931dea701442a03785475faf226271607754
Parents: 4590813
Author: Donal Lafferty <donal.lafferty@citrix.com>
Authored: Wed Oct 2 14:15:42 2013 +0530
Committer: Devdeep Singh <devdeep@gmail.com>
Committed: Wed Oct 2 14:37:22 2013 +0530

----------------------------------------------------------------------
 client/pom.xml                                  |   11 +
 client/tomcatconf/applicationContext.xml.in     |    8 +
 client/tomcatconf/componentContext.xml.in       |    1 +
 .../tomcatconf/simulatorComponentContext.xml.in |    1 +
 .../hyperv/DotNet/ServerResource/.gitignore     |    8 +
 .../AgentShell/AgentService.Designer.cs         |   53 +
 .../ServerResource/AgentShell/AgentService.cs   |  131 +
 .../AgentShell/AgentSettings.Designer.cs        |  371 +++
 .../AgentShell/AgentSettings.settings           |  102 +
 .../ServerResource/AgentShell/AgentShell.csproj |  135 +
 .../AgentShell/AgentShellException.cs           |   28 +
 .../DotNet/ServerResource/AgentShell/App.config |  145 +
 .../DotNet/ServerResource/AgentShell/Program.cs |   58 +
 .../AgentShell/Properties/AssemblyInfo.cs       |   39 +
 .../ServerResource/AgentShell/packages.config   |   10 +
 .../ServerResource/HypervResource/App.config    |  128 +
 .../HypervResource/CloudStackTypes.cs           |  642 +++++
 .../HypervResource/HypervResource.csproj        |  102 +
 .../HypervResource/HypervResourceController.cs  | 1399 ++++++++++
 .../HypervResource/Properties/AssemblyInfo.cs   |   36 +
 .../ServerResource/HypervResource/Utils.cs      |  110 +
 .../ServerResource/HypervResource/WmiCalls.cs   | 1469 ++++++++++
 .../HypervResource/packages.config              |    7 +
 .../ServerResource.Tests/App.config             |  128 +
 .../HypervResourceControllerTest.cs             | 1064 ++++++++
 .../Properties/AssemblyInfo.cs                  |   35 +
 .../ServerResource.Tests.csproj                 |  124 +
 .../ServerResource.Tests/packages.config        |    6 +
 .../DotNet/ServerResource/ServerResource.sln    |   61 +
 .../WmiWrappers/Properties/AssemblyInfo.cs      |   36 +
 .../ROOT.CIMV2.Win32_OperatingSystem.cs         | 2435 +++++++++++++++++
 .../WmiWrappers/ROOT.CIMV2.Win32_Processor.cs   | 2523 ++++++++++++++++++
 .../ROOT.virtualization.Msvm_ComputerSystem.cs  | 1298 +++++++++
 .../ROOT.virtualization.Msvm_ConcreteJob.cs     | 1665 ++++++++++++
 ....virtualization.Msvm_ExternalEthernetPort.cs | 1996 ++++++++++++++
 .../ROOT.virtualization.Msvm_IDEController.cs   | 1610 +++++++++++
 ...irtualization.Msvm_ImageManagementService.cs | 1401 ++++++++++
 ...OOT.virtualization.Msvm_MemorySettingData.cs | 1083 ++++++++
 ....virtualization.Msvm_ProcessorSettingData.cs | 1190 +++++++++
 ...zation.Msvm_ResourceAllocationSettingData.cs |  976 +++++++
 ...OT.virtualization.Msvm_SummaryInformation.cs | 1184 ++++++++
 ...OOT.virtualization.Msvm_SwitchLANEndpoint.cs | 1342 ++++++++++
 .../ROOT.virtualization.Msvm_SwitchPort.cs      | 1708 ++++++++++++
 ...virtualization.Msvm_SyntheticEthernetPort.cs | 1960 ++++++++++++++
 ...ion.Msvm_SyntheticEthernetPortSettingData.cs | 1010 +++++++
 .../ROOT.virtualization.Msvm_VLANEndpoint.cs    | 1390 ++++++++++
 ...rtualization.Msvm_VLANEndpointSettingData.cs |  885 ++++++
 .../ROOT.virtualization.Msvm_VirtualSwitch.cs   | 1305 +++++++++
 ...ation.Msvm_VirtualSwitchManagementService.cs | 1379 ++++++++++
 ...ation.Msvm_VirtualSystemGlobalSettingData.cs | 1513 +++++++++++
 ...ation.Msvm_VirtualSystemManagementService.cs | 1731 ++++++++++++
 ...VirtualSystemManagementServiceSettingData.cs |  731 +++++
 ...tualization.Msvm_VirtualSystemSettingData.cs | 1206 +++++++++
 .../ROOT.virtualization.Msvm_VmLANEndpoint.cs   | 1342 ++++++++++
 .../ServerResource/WmiWrappers/Readme.txt       |   20 +
 .../WmiWrappers/WmiWrappers.csproj              |  146 +
 ...rmattedData_Counters_ProcessorInformation.cs | 1737 ++++++++++++
 plugins/hypervisors/hyperv/buildagent.sh        |   22 +
 .../hypervisors/hyperv/conf/agent.properties    |   35 +
 .../hyperv/conf/developer.properties.template   |   55 +
 .../hyperv/conf/environment.properties.in       |   21 +
 plugins/hypervisors/hyperv/conf/log4j-cloud.xml |   93 +
 .../hypervisors/hyperv/conf/log4j-cloud.xml.in  |   93 +
 plugins/hypervisors/hyperv/conf/log4j.xml       |   93 +
 plugins/hypervisors/hyperv/pom.xml              |  158 ++
 .../hyperv/scripts/dev_extra_setup.sh           |    8 +
 .../discoverer/HypervServerDiscoverer.java      |  467 ++++
 .../hypervisor/hyperv/guru/HypervGuru.java      |   68 +
 .../resource/HypervDirectConnectResource.java   |  454 ++++
 .../test/HypervDirectConnectResourceTest.java   |  938 +++++++
 plugins/pom.xml                                 |   12 +
 71 files changed, 45731 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index fd1f13a..2297182 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -143,6 +143,17 @@
     </dependency>
     <dependency>
       <groupId>org.apache.cloudstack</groupId>
+      <artifactId>cloud-plugin-hypervisor-hyperv</artifactId>
+      <version>${project.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.mortbay.jetty</groupId>
+          <artifactId>servlet-api</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cloudstack</groupId>
       <artifactId>cloud-plugin-storage-allocator-random</artifactId>
       <version>${project.version}</version>
     </dependency>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index 9b6636a..44ab97e 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -532,6 +532,10 @@
     <property name="name" value="Lxc Discover"/>
   </bean>
 
+  <bean id="HypervServerDiscoverer" class="com.cloud.hypervisor.hyperv.discoverer.HypervServerDiscoverer">
+    <property name="name" value="Hyper-V Agent"/>
+  </bean>
+
   <bean id="OvmDiscoverer" class="com.cloud.ovm.hypervisor.OvmDiscoverer">
     <property name="name" value="Ovm Discover"/>
   </bean>
@@ -609,6 +613,10 @@
     <property name="name" value="OvmGuru"/>
   </bean>
 
+  <bean id="HypervGuru" class="com.cloud.hypervisor.hyperv.guru.HypervGuru">
+    <property name="name" value="HypervGuru"/>
+  </bean> 
+
   <!--=====================================================================================================-->
   <!--                                                                                                     -->
   <!--                           Storage Subsystem Components and Helpers                                  -->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/client/tomcatconf/componentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in
index df5b002..1f1d072 100644
--- a/client/tomcatconf/componentContext.xml.in
+++ b/client/tomcatconf/componentContext.xml.in
@@ -167,6 +167,7 @@
           <ref bean="SecondaryStorageDiscoverer"/>
           <ref bean="KvmServerDiscoverer"/>
           <ref bean="LxcServerDiscoverer"/>
+          <ref bean="HypervServerDiscoverer"/>
           <ref bean="BareMetalDiscoverer"/>
           <ref bean="OvmDiscoverer"/>
       </list>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/client/tomcatconf/simulatorComponentContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/simulatorComponentContext.xml.in b/client/tomcatconf/simulatorComponentContext.xml.in
index 82ff433..b2ba6c6 100644
--- a/client/tomcatconf/simulatorComponentContext.xml.in
+++ b/client/tomcatconf/simulatorComponentContext.xml.in
@@ -104,6 +104,7 @@
     <property name="Adapters">
       <list>
         <ref bean="SimulatorDiscoverer"/>
+        <ref bean="HypervServerDiscoverer"/>
         <ref bean="SimulatorSecondaryDiscoverer"/>
         <ref bean="XcpServerDiscoverer"/>
         <ref bean="SecondaryStorageDiscoverer"/>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/.gitignore
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/.gitignore b/plugins/hypervisors/hyperv/DotNet/ServerResource/.gitignore
new file mode 100644
index 0000000..cf9cb85
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/.gitignore
@@ -0,0 +1,8 @@
+packages
+*.suo
+*/obj/*
+WmiWrappers/bin/*
+AgentShell/bin/*
+ServerResource*/bin/*
+*.user
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.Designer.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.Designer.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.Designer.cs
new file mode 100644
index 0000000..8544277
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.Designer.cs
@@ -0,0 +1,53 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+namespace CloudStack.Plugin.AgentShell
+{
+    partial class AgentService
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            components = new System.ComponentModel.Container();
+            this.ServiceName = "CloudStack ServerResource";
+        }
+
+        #endregion
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs
new file mode 100644
index 0000000..781014c
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs
@@ -0,0 +1,131 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.ServiceProcess;
+using System.Text;
+using System.Threading.Tasks;
+using System.Web.Http.SelfHost;
+using System.Web.Http;
+using log4net;
+using HypervResource;
+
+namespace CloudStack.Plugin.AgentShell
+{
+    public partial class AgentService : ServiceBase
+    {
+        [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)]
+        static extern bool AllocConsole();
+
+        [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)]
+        static extern bool FreeConsole();
+
+        HttpSelfHostServer server;
+
+        private static ILog logger = LogManager.GetLogger(typeof(AgentService));
+
+        public AgentService()
+        {
+            logger.Info("Starting CloudStack agent");
+            InitializeComponent();
+
+            UriBuilder baseUri = new UriBuilder("http", AgentSettings.Default.private_ip_address, AgentSettings.Default.port);
+
+            var config = new HttpSelfHostConfiguration(baseUri.Uri);
+
+           // Allow ActionName to be applied to methods in ApiController, which allows it to serve multiple POST URLs
+            config.Routes.MapHttpRoute(
+                  "API Default", "api/{controller}/{action}",
+                  new { action = RouteParameter.Optional }
+                    );
+
+            // Load controller assemblies that we want to config to route to.
+            ConfigServerResource();
+            AssertControllerAssemblyAvailable(config, typeof(HypervResourceController), "Cannot load Controller of type" + typeof(HypervResourceController));
+
+            server = new HttpSelfHostServer(config);
+        }
+
+        public static void ConfigServerResource()
+        {
+            // For simplicity, ServerResource config and settings file are tightly coupled.
+            // An alternative is to pass a dictionary to the server resource and let it find 
+            // required settings.  In contrast, the approach below is strongly typed and makes
+            // use of VisualStudio settings designer.  The designer allows us to avoid
+            // accessing config using their key strings.
+            HypervResourceControllerConfig rsrcCnf = new HypervResourceControllerConfig();
+            rsrcCnf.PrivateIpAddress = AgentSettings.Default.private_ip_address;
+            rsrcCnf.GatewayIpAddress = AgentSettings.Default.gateway_ip_address;
+            rsrcCnf.RootDeviceReservedSpaceBytes = AgentSettings.Default.RootDeviceReservedSpaceBytes;
+            rsrcCnf.RootDeviceName = AgentSettings.Default.RootDeviceName;
+            rsrcCnf.ParentPartitionMinMemoryMb = AgentSettings.Default.dom0MinMemory;
+            rsrcCnf.LocalSecondaryStoragePath = AgentSettings.Default.local_secondary_storage_path;
+
+            // Side effect:  loads the assembly containing HypervResourceController, which
+            // allows HttpSelfHostServer to route requests to the controller.
+            HypervResourceController.Configure(rsrcCnf);
+
+        }
+
+        // TODO:  update to examine not the assembly resolver, but the list of available controllers themselves!
+        private static bool AssertControllerAssemblyAvailable(HttpSelfHostConfiguration config, Type controllerType, string errorMessage)
+        {
+            var assemblies = config.Services.GetAssembliesResolver().GetAssemblies();
+            foreach (var assembly in assemblies)
+            {
+                string name = assembly.GetName().Name;
+                if (controllerType.Assembly.GetName().Name.Equals(name))
+                {
+                    logger.DebugFormat("Controller {0} is available", controllerType.Name);
+                    return true;
+                }
+            }
+
+            logger.Error(errorMessage);
+            throw new AgentShellException(errorMessage);
+        }
+
+        protected override void OnStart(string[] args)
+        {
+            server.OpenAsync().Wait();
+        }
+
+        protected override void OnStop()
+        {
+            server.CloseAsync().Wait();
+        }
+
+        internal void RunConsole(string[] args)
+        {
+            OnStart(args);
+
+            AllocConsole();
+
+            Console.WriteLine("Service running ... press <ENTER> to stop");
+
+            Console.ReadLine();
+
+            FreeConsole();
+
+            OnStop();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.Designer.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.Designer.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.Designer.cs
new file mode 100644
index 0000000..44df706
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.Designer.cs
@@ -0,0 +1,371 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.17929
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CloudStack.Plugin.AgentShell {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    public sealed partial class AgentSettings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static AgentSettings defaultInstance = ((AgentSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new AgentSettings())));
+        
+        public static AgentSettings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("8")]
+        public int cpus {
+            get {
+                return ((int)(this["cpus"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Routing")]
+        public string type {
+            get {
+                return ((string)(this["type"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("5fe2bad3-d785-394e-9949-89786b8a63d2")]
+        public global::System.Guid local_storage_uuid {
+            get {
+                return ((global::System.Guid)(this["local_storage_uuid"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("hvm")]
+        public string capabilities {
+            get {
+                return ((string)(this["capabilities"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("2130")]
+        public int Settingcpuspeed {
+            get {
+                return ((int)(this["Settingcpuspeed"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("8250")]
+        public int port {
+            get {
+                return ((int)(this["port"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("34359738368")]
+        public long memory {
+            get {
+                return ((long)(this["memory"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("camldonall01.citrite.net")]
+        public string host {
+            get {
+                return ((string)(this["host"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("1")]
+        public int pod {
+            get {
+                return ((int)(this["pod"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("10.1.1.1")]
+        public string gateway_ip_address {
+            get {
+                return ((string)(this["gateway_ip_address"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::System.Guid guid {
+            get {
+                return ((global::System.Guid)(this["guid"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("2")]
+        public int cluster {
+            get {
+                return ((int)(this["cluster"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("1")]
+        public int zone {
+            get {
+                return ((int)(this["zone"]));
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("c:\\Secondary")]
+        public string local_secondary_storage_path {
+            get {
+                return ((string)(this["local_secondary_storage_path"]));
+            }
+            set {
+                this["local_secondary_storage_path"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("E:\\Disks\\Disks")]
+        public string local_storage_path {
+            get {
+                return ((string)(this["local_storage_path"]));
+            }
+            set {
+                this["local_storage_path"] = value;
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("5")]
+        public int workers {
+            get {
+                return ((int)(this["workers"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("255.255.240.0")]
+        public string private_ip_netmask {
+            get {
+                return ((string)(this["private_ip_netmask"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("4294967296")]
+        public long RootDeviceReservedSpaceBytes {
+            get {
+                return ((long)(this["RootDeviceReservedSpaceBytes"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("..\\..\\..\\..\\..\\")]
+        public string hyperv_plugin_root {
+            get {
+                return ((string)(this["hyperv_plugin_root"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("e:\\")]
+        public string RootDeviceName {
+            get {
+                return ((string)(this["RootDeviceName"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("101F742C6B88")]
+        public string private_mac_address {
+            get {
+                return ((string)(this["private_mac_address"]));
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute(".\\var\\test\\storagepool")]
+        public string testLocalStorePath {
+            get {
+                return ((string)(this["testLocalStorePath"]));
+            }
+            set {
+                this["testLocalStorePath"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("testS3Bucket")]
+        public string testS3Bucket {
+            get {
+                return ((string)(this["testS3Bucket"]));
+            }
+            set {
+                this["testS3Bucket"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("testS3Endpoint")]
+        public string testS3Endpoint {
+            get {
+                return ((string)(this["testS3Endpoint"]));
+            }
+            set {
+                this["testS3Endpoint"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("testS3AccessKey")]
+        public string testS3AccessKey {
+            get {
+                return ((string)(this["testS3AccessKey"]));
+            }
+            set {
+                this["testS3AccessKey"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("testS3SecretKey")]
+        public string testS3SecretKey {
+            get {
+                return ((string)(this["testS3SecretKey"]));
+            }
+            set {
+                this["testS3SecretKey"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("206-2-73592258-559a-3b38-8f66-b667aab143eb")]
+        public string testS3TemplateName {
+            get {
+                return ((string)(this["testS3TemplateName"]));
+            }
+            set {
+                this["testS3TemplateName"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("5fe2bad3-d785-394e-9949-89786b8a63d2")]
+        public string testLocalStoreUUID {
+            get {
+                return ((string)(this["testLocalStoreUUID"]));
+            }
+            set {
+                this["testLocalStoreUUID"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("acton-systemvm-02062012.vhd.bz2")]
+        public string testSystemVMTemplateName {
+            get {
+                return ((string)(this["testSystemVMTemplateName"]));
+            }
+            set {
+                this["testSystemVMTemplateName"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("acton-systemvm-02062012")]
+        public string testSystemVMTemplateNameNoExt {
+            get {
+                return ((string)(this["testSystemVMTemplateNameNoExt"]));
+            }
+            set {
+                this["testSystemVMTemplateNameNoExt"] = value;
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("2048")]
+        public ulong dom0MinMemory {
+            get {
+                return ((ulong)(this["dom0MinMemory"]));
+            }
+        }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("10.1.1.1")]
+        public string private_ip_address {
+            get {
+                return ((string)(this["private_ip_address"]));
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("cifs://10.1.1.1/secondary?user\\u003dadministrator\\u0026password\\u003d1pass%40w" +
+            "ord1")]
+        public string testCifsUrl {
+            get {
+                return ((string)(this["testCifsUrl"]));
+            }
+            set {
+                this["testCifsUrl"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("template/tmpl/2/201/61d5316a-3cc4-30cf-a557-78691ff5c143.vhd")]
+        public string testCifsPath {
+            get {
+                return ((string)(this["testCifsPath"]));
+            }
+            set {
+                this["testCifsPath"] = value;
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.settings
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.settings b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.settings
new file mode 100644
index 0000000..0d54f44
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.settings
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="CloudStack.Plugin.AgentShell" GeneratedClassName="AgentSettings">
+  <Profiles />
+  <Settings>
+    <Setting Name="cpus" Type="System.Int32" Scope="Application">
+      <Value Profile="(Default)">8</Value>
+    </Setting>
+    <Setting Name="private_ip_address" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">10.70.176.29</Value>
+    </Setting>
+    <Setting Name="type" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">Routing</Value>
+    </Setting>
+    <Setting Name="local_storage_uuid" Type="System.Guid" Scope="Application">
+      <Value Profile="(Default)">5fe2bad3-d785-394e-9949-89786b8a63d2</Value>
+    </Setting>
+    <Setting Name="capabilities" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">hvm</Value>
+    </Setting>
+    <Setting Name="Settingcpuspeed" Type="System.Int32" Scope="Application">
+      <Value Profile="(Default)">2130</Value>
+    </Setting>
+    <Setting Name="port" Type="System.Int32" Scope="Application">
+      <Value Profile="(Default)">8250</Value>
+    </Setting>
+    <Setting Name="memory" Type="System.Int64" Scope="Application">
+      <Value Profile="(Default)">34359738368</Value>
+    </Setting>
+    <Setting Name="host" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">camldonall01.citrite.net</Value>
+    </Setting>
+    <Setting Name="pod" Type="System.Int32" Scope="Application">
+      <Value Profile="(Default)">1</Value>
+    </Setting>
+    <Setting Name="gateway_ip_address" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">10.70.176.1</Value>
+    </Setting>
+    <Setting Name="guid" Type="System.Guid" Scope="Application">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="cluster" Type="System.Int32" Scope="Application">
+      <Value Profile="(Default)">2</Value>
+    </Setting>
+    <Setting Name="zone" Type="System.Int32" Scope="Application">
+      <Value Profile="(Default)">1</Value>
+    </Setting>
+    <Setting Name="local_secondary_storage_path" Type="System.String" Scope="User">
+      <Value Profile="(Default)">c:\Secondary</Value>
+    </Setting>
+    <Setting Name="local_storage_path" Type="System.String" Scope="User">
+      <Value Profile="(Default)">E:\Disks\Disks</Value>
+    </Setting>
+    <Setting Name="workers" Type="System.Int32" Scope="Application">
+      <Value Profile="(Default)">5</Value>
+    </Setting>
+    <Setting Name="private_ip_netmask" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">255.255.240.0</Value>
+    </Setting>
+    <Setting Name="RootDeviceReservedSpaceBytes" Type="System.Int64" Scope="Application">
+      <Value Profile="(Default)">4294967296</Value>
+    </Setting>
+    <Setting Name="hyperv_plugin_root" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">..\..\..\..\..\</Value>
+    </Setting>
+    <Setting Name="RootDeviceName" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">e:\</Value>
+    </Setting>
+    <Setting Name="private_mac_address" Type="System.String" Scope="Application">
+      <Value Profile="(Default)">101F742C6B88</Value>
+    </Setting>
+    <Setting Name="testLocalStorePath" Type="System.String" Scope="User">
+      <Value Profile="(Default)">.\var\test\storagepool</Value>
+    </Setting>
+    <Setting Name="testS3Bucket" Type="System.String" Scope="User">
+      <Value Profile="(Default)">testS3Bucket</Value>
+    </Setting>
+    <Setting Name="testS3Endpoint" Type="System.String" Scope="User">
+      <Value Profile="(Default)">testS3Endpoint</Value>
+    </Setting>
+    <Setting Name="testS3AccessKey" Type="System.String" Scope="User">
+      <Value Profile="(Default)">testS3AccessKey</Value>
+    </Setting>
+    <Setting Name="testS3SecretKey" Type="System.String" Scope="User">
+      <Value Profile="(Default)">testS3SecretKey</Value>
+    </Setting>
+    <Setting Name="testS3TemplateName" Type="System.String" Scope="User">
+      <Value Profile="(Default)">206-2-73592258-559a-3b38-8f66-b667aab143eb</Value>
+    </Setting>
+    <Setting Name="testLocalStoreUUID" Type="System.String" Scope="User">
+      <Value Profile="(Default)">5fe2bad3-d785-394e-9949-89786b8a63d2</Value>
+    </Setting>
+    <Setting Name="testSystemVMTemplateName" Type="System.String" Scope="User">
+      <Value Profile="(Default)">acton-systemvm-02062012.vhd.bz2</Value>
+    </Setting>
+    <Setting Name="testSystemVMTemplateNameNoExt" Type="System.String" Scope="User">
+      <Value Profile="(Default)">acton-systemvm-02062012</Value>
+    </Setting>
+    <Setting Name="dom0MinMemory" Type="System.UInt64" Scope="Application">
+      <Value Profile="(Default)">2048</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentShell.csproj
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentShell.csproj b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentShell.csproj
new file mode 100644
index 0000000..fe055d0
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentShell.csproj
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{9060B539-62D0-4E71-A6C6-5944828774E9}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>CloudStack.Plugin.AgentShell</RootNamespace>
+    <AssemblyName>AgentShell</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTestsDebug|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\NoUnitTestsDebug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'NoUnitTests|AnyCPU'">
+    <OutputPath>bin\NoUnitTests\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Ionic.Zip">
+      <HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
+    </Reference>
+    <Reference Include="log4net">
+      <HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
+    </Reference>
+    <Reference Include="Newtonsoft.Json">
+      <HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Management" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Net.Http.WebRequest" />
+    <Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Web.Http.SelfHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.AspNet.WebApi.SelfHost.4.0.20918.0\lib\net40\System.Web.Http.SelfHost.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.ServiceProcess" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="AgentService.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="AgentService.Designer.cs">
+      <DependentUpon>AgentService.cs</DependentUpon>
+    </Compile>
+    <Compile Include="AgentShellException.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="AgentSettings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+      <DependentUpon>AgentSettings.settings</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config">
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="packages.config">
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="AgentSettings.settings">
+      <Generator>PublicSettingsSingleFileGenerator</Generator>
+      <LastGenOutput>AgentSettings.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HypervResource\HypervResource.csproj">
+      <Project>{c963dfff-65ba-4e71-ada5-526a4da4e0b2}</Project>
+      <Name>HypervResource</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\WmiWrappers\WmiWrappers.csproj">
+      <Project>{db824727-bdc3-437c-a364-7a811d8a160f}</Project>
+      <Name>WmiWrappers</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentShellException.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentShellException.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentShellException.cs
new file mode 100644
index 0000000..14d9e97
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentShellException.cs
@@ -0,0 +1,28 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace CloudStack.Plugin.AgentShell
+{
+    class AgentShellException : Exception
+    {
+        public AgentShellException(string errMsg) : base(errMsg) { }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/App.config
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/App.config b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/App.config
new file mode 100644
index 0000000..444f641
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/App.config
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+  <configSections>
+    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
+    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+      <section name="CloudStack.Plugin.AgentShell.AgentSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+    </sectionGroup>
+    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+      <section name="CloudStack.Plugin.AgentShell.AgentSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+    </sectionGroup>
+  </configSections>
+
+  <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
+    </startup>
+
+  <log4net>
+    <appender name="FileAppender" type="log4net.Appender.FileAppender">
+      <file value="cloudstack-agent.log" />
+      <appendToFile value="true" />
+      <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
+      <layout type="log4net.Layout.PatternLayout">
+        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
+      </layout>
+    </appender>
+    <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
+      <appendToFile value="true" />
+      <layout type="log4net.Layout.PatternLayout">
+        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"/>
+      </layout>
+    </appender>
+    <root>
+      <level value="ALL"/>
+      <appender-ref ref="FileAppender"/>
+    </root>
+  </log4net>
+  
+  <applicationSettings>
+    <CloudStack.Plugin.AgentShell.AgentSettings>
+      <setting name="cpus" serializeAs="String">
+        <value>8</value>
+      </setting>
+      <setting name="type" serializeAs="String">
+        <value>Routing</value>
+      </setting>
+      <setting name="local_storage_uuid" serializeAs="String">
+        <value>5fe2bad3-d785-394e-9949-89786b8a63d2</value>
+      </setting>
+      <setting name="capabilities" serializeAs="String">
+        <value>hvm</value>
+      </setting>
+      <setting name="Settingcpuspeed" serializeAs="String">
+        <value>2130</value>
+      </setting>
+      <setting name="port" serializeAs="String">
+        <value>8250</value>
+      </setting>
+      <setting name="memory" serializeAs="String">
+        <value>34359738368</value>
+      </setting>
+      <setting name="host" serializeAs="String">
+        <value>camldonall01.citrite.net</value>
+      </setting>
+      <setting name="pod" serializeAs="String">
+        <value>1</value>
+      </setting>
+      <setting name="gateway_ip_address" serializeAs="String">
+        <value>10.70.176.1</value>
+      </setting>
+      <setting name="cluster" serializeAs="String">
+        <value>2</value>
+      </setting>
+      <setting name="zone" serializeAs="String">
+        <value>1</value>
+      </setting>
+      <setting name="workers" serializeAs="String">
+        <value>5</value>
+      </setting>
+      <setting name="private_ip_netmask" serializeAs="String">
+        <value>255.255.240.0</value>
+      </setting>
+      <setting name="RootDeviceReservedSpaceBytes" serializeAs="String">
+        <value>4294967296</value>
+      </setting>
+      <setting name="hyperv_plugin_root" serializeAs="String">
+        <value>..\..\..\..\..\</value>
+      </setting>
+      <setting name="RootDeviceName" serializeAs="String">
+        <value>e:\</value>
+      </setting>
+      <setting name="private_mac_address" serializeAs="String">
+        <value>101F742C6B88</value>
+      </setting>
+      <setting name="dom0MinMemory" serializeAs="String">
+        <value>2048</value>
+      </setting>
+      <setting name="private_ip_address" serializeAs="String">
+        <value>10.70.1.1</value>
+      </setting>
+    </CloudStack.Plugin.AgentShell.AgentSettings>
+   </applicationSettings>
+  <userSettings>
+    <CloudStack.Plugin.AgentShell.AgentSettings>
+      <setting name="local_secondary_storage_path" serializeAs="String">
+        <value>c:\Secondary</value>
+      </setting>
+      <setting name="local_storage_path" serializeAs="String">
+        <value>E:\Disks\Disks</value>
+      </setting>
+      <setting name="testLocalStorePath" serializeAs="String">
+        <value>.\var\test\storagepool</value>
+      </setting>
+      <setting name="testS3Bucket" serializeAs="String">
+        <value>testS3Bucket</value>
+      </setting>
+      <setting name="testS3Endpoint" serializeAs="String">
+        <value>testS3Endpoint</value>
+      </setting>
+      <setting name="testS3AccessKey" serializeAs="String">
+        <value>testS3AccessKey</value>
+      </setting>
+      <setting name="testS3SecretKey" serializeAs="String">
+        <value>testS3SecretKey</value>
+      </setting>
+      <setting name="testS3TemplateName" serializeAs="String">
+        <value>206-2-73592258-559a-3b38-8f66-b667aab143eb</value>
+      </setting>
+      <setting name="testLocalStoreUUID" serializeAs="String">
+        <value>5fe2bad3-d785-394e-9949-89786b8a63d2</value>
+      </setting>
+      <setting name="testSystemVMTemplateName" serializeAs="String">
+        <value>acton-systemvm-02062012.vhd.bz2</value>
+      </setting>
+      <setting name="testSystemVMTemplateNameNoExt" serializeAs="String">
+        <value>acton-systemvm-02062012</value>
+      </setting>
+      <setting name="testCifsUrl" serializeAs="String">
+        <value>cifs://10.70.1.1/secondary?user\u003dadministrator\u0026password\u003d1pass%40word1</value>
+      </setting>
+      <setting name="testCifsPath" serializeAs="String">
+        <value>template/tmpl/2/201/61d5316a-3cc4-30cf-a557-78691ff5c143.vhd</value>
+      </setting>
+    </CloudStack.Plugin.AgentShell.AgentSettings>
+  </userSettings>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Program.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Program.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Program.cs
new file mode 100644
index 0000000..1066370
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Program.cs
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+using log4net;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.ServiceProcess;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CloudStack.Plugin.AgentShell
+{
+    static class Program
+    {
+        private static ILog logger = LogManager.GetLogger(typeof(Program));
+
+        /// <summary>
+        /// Application entry point allows service to run in console application or as a Windows service.
+        /// Add '--console' to the commandline for the former, the latter is the default.
+        /// </summary>
+        static void Main(params string[] args)
+        {
+            string arg1 = string.Empty;
+
+            if (args.Length > 0)
+            {
+                arg1 = args[0];
+                logger.DebugFormat("CloudStack ServerResource arg is ", arg1);
+            }
+
+            if (string.Compare(arg1, "--console", true) == 0)
+            {
+                logger.InfoFormat("CloudStack ServerResource running as console app");
+                new AgentService().RunConsole(args);
+            }
+            else
+            {
+                logger.InfoFormat("CloudStack ServerResource running as Windows Service");
+                ServiceBase[] ServicesToRun = new ServiceBase[] { new AgentService() };
+                ServiceBase.Run(ServicesToRun);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Properties/AssemblyInfo.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..ca7a23b
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Properties/AssemblyInfo.cs
@@ -0,0 +1,39 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("AgentShell")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("AgentShell")]
+[assembly: AssemblyCopyright("Copyright ©  2013")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("a6d8469a-c815-4765-a4a1-4927d4e3c583")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+
+
+[assembly: log4net.Config.XmlConfigurator(Watch = true)]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/packages.config
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/packages.config b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/packages.config
new file mode 100644
index 0000000..f5f47e6
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/packages.config
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="DotNetZip" version="1.9.1.8" targetFramework="net45" />
+  <package id="log4net" version="2.0.0" targetFramework="net45" />
+  <package id="Microsoft.AspNet.WebApi.Client" version="4.0.20710.0" targetFramework="net45" />
+  <package id="Microsoft.AspNet.WebApi.Core" version="4.0.20710.0" targetFramework="net45" />
+  <package id="Microsoft.AspNet.WebApi.SelfHost" version="4.0.20918.0" targetFramework="net45" />
+  <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
+  <package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" />
+</packages>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1d0a931d/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/App.config
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/App.config b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/App.config
new file mode 100644
index 0000000..1bf17d4
--- /dev/null
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/App.config
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- 
+    Note: Add entries to the App.config file for configuration settings
+    that apply only to the Test project.
+-->
+<configuration>
+  <configSections>
+    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+      <section name="CloudStack.Plugin.AgentShell.AgentSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+    </sectionGroup>
+    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+      <section name="CloudStack.Plugin.AgentShell.AgentSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+    </sectionGroup>
+  </configSections>
+
+  <appSettings>
+    </appSettings>
+    <connectionStrings>
+    </connectionStrings>
+
+  <applicationSettings>
+    <CloudStack.Plugin.AgentShell.AgentSettings>
+      <setting name="cpus" serializeAs="String">
+        <value>8</value>
+      </setting>
+      <setting name="private_ip_address" serializeAs="String">
+        <value>10.1.1.1</value>
+      </setting>
+      <setting name="type" serializeAs="String">
+        <value>Routing</value>
+      </setting>
+      <setting name="local_storage_uuid" serializeAs="String">
+        <value>5fe2bad3-d785-394e-9949-89786b8a63d2</value>
+      </setting>
+      <setting name="capabilities" serializeAs="String">
+        <value>hvm</value>
+      </setting>
+      <setting name="Settingcpuspeed" serializeAs="String">
+        <value>2130</value>
+      </setting>
+      <setting name="port" serializeAs="String">
+        <value>8250</value>
+      </setting>
+      <setting name="memory" serializeAs="String">
+        <value>34359738368</value>
+      </setting>
+      <setting name="host" serializeAs="String">
+        <value>camldonall01.citrite.net</value>
+      </setting>
+      <setting name="pod" serializeAs="String">
+        <value>1</value>
+      </setting>
+      <setting name="gateway_ip_address" serializeAs="String">
+        <value>10.70.176.1</value>
+      </setting>
+      <setting name="cluster" serializeAs="String">
+        <value>2</value>
+      </setting>
+      <setting name="zone" serializeAs="String">
+        <value>1</value>
+      </setting>
+      <setting name="local_storage_path" serializeAs="String">
+        <value>E:\Disks\Disks</value>
+      </setting>
+      <setting name="workers" serializeAs="String">
+        <value>5</value>
+      </setting>
+      <setting name="private_ip_netmask" serializeAs="String">
+        <value>255.255.240.0</value>
+      </setting>
+      <setting name="RootDeviceReservedSpaceBytes" serializeAs="String">
+        <value>4294967296</value>
+      </setting>
+      <setting name="hyperv_plugin_root" serializeAs="String">
+        <value>..\..\..\..\..\</value>
+      </setting>
+      <setting name="RootDeviceName" serializeAs="String">
+        <value>e:\</value>
+      </setting>
+      <setting name="dom0MinMemory" serializeAs="String">
+        <value>2048</value>
+      </setting>
+      <setting name="private_mac_address" serializeAs="String">
+        <value>101F742C6B88</value>
+      </setting>
+    </CloudStack.Plugin.AgentShell.AgentSettings>
+  </applicationSettings>
+  <userSettings>
+    <CloudStack.Plugin.AgentShell.AgentSettings>
+      <setting name="local_secondary_storage_path" serializeAs="String">
+        <value>c:\Secondary</value>
+      </setting>
+      <setting name="local_storage_path" serializeAs="String">
+        <value>E:\Disks\Disks</value>
+      </setting>
+      <setting name="testLocalStoreUUID" serializeAs="String">
+        <value>5fe2bad3-d785-394e-9949-89786b8a63d2</value>
+      </setting>
+      <setting name="testLocalStorePath" serializeAs="String">
+        <value>.\var\test\storagepool</value>
+      </setting>
+      <setting name="testS3Bucket" serializeAs="String">
+        <value>cshv3eu</value>
+      </setting>
+      <setting name="testS3Endpoint" serializeAs="String">
+        <value>s3.amazonaws.com</value>
+      </setting>
+      <setting name="testS3AccessKey" serializeAs="String">
+        <value>testS3AccessKey</value>
+      </setting>
+      <setting name="testS3SecretKey" serializeAs="String">
+        <value>testS3SecretKey</value>
+      </setting>
+      <setting name="testS3TemplateName" serializeAs="String">
+        <value>206-2-73592258-559a-3b38-8f66-b667aab143eb</value>
+      </setting>
+      <setting name="testCifsTemplateName" serializeAs="String">
+        <value>206-2-73592258-559a-3b38-8f66-b667aab143eb</value>
+      </setting>
+      <setting name="testCifsUrl" serializeAs="String">
+        <value>cifs://10.1.1.1/secondary?user\u003dadministrator\u0026password\u003d1pass%40word1</value>
+      </setting>
+      <setting name="testCifsPath" serializeAs="String">
+        <value>template/tmpl/2/201/6dda6631-4daa-3150-a49a-d5a4b0a4c4b6.vhd</value>
+      </setting>
+    </CloudStack.Plugin.AgentShell.AgentSettings>
+  </userSettings>
+</configuration>


Mime
View raw message