Example #1
0
        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.RootDeviceReservedSpaceBytes = AgentSettings.Default.RootDeviceReservedSpaceBytes;
            rsrcCnf.RootDeviceName = AgentSettings.Default.RootDeviceName;
            rsrcCnf.ParentPartitionMinMemoryMb = AgentSettings.Default.dom0MinMemory;
            rsrcCnf.LocalSecondaryStoragePath = AgentSettings.Default.local_secondary_storage_path;
            rsrcCnf.systemVmIso = null;

            // Side effect:  loads the assembly containing HypervResourceController, which
            // allows HttpSelfHostServer to route requests to the controller.
            HypervResourceController.Configure(rsrcCnf);
        }
 public static void Configure(HypervResourceControllerConfig config)
 {
     HypervResourceController.config = config;
     wmiCallsV2 = new WmiCallsV2();
 }
 public static void Configure(HypervResourceControllerConfig config)
 {
     HypervResourceController.config = config;
 }