예제 #1
0
        private void GetCloudConfigParameters(VDI configDrive)
        {
            var defaultConfig = configDrive == null;
            var parameters    = new Dictionary <string, string>();

            if (defaultConfig)
            {
                parameters.Add("templateuuid", vmOrTemplate.uuid);
            }
            else
            {
                parameters.Add("vdiuuid", configDrive.uuid);
            }

            var action = new ExecutePluginAction(Connection, Affinity ?? Helpers.GetMaster(Connection),
                                                 "xscontainer",                                                                 //plugin
                                                 defaultConfig ? "get_config_drive_default" : "get_config_drive_configuration", //function
                                                 parameters,
                                                 true);                                                                         //hidefromlogs

            try
            {
                action.RunExternal(Connection.Session);
                var result = action.Result.Replace("\n", Environment.NewLine);
                ConfigDriveTemplateTextBox.Text = result;
                existingConfig = result;
                errorRetrievingConfigParameters = false;
            }
            catch (Exception)
            {
                log.Warn("Could not get the config drive parameters");
                errorRetrievingConfigParameters = true;
            }
        }
예제 #2
0
        private void CloudCreateConfigDrive()
        {
            if (Template.CanHaveCloudConfigDrive() && !string.IsNullOrEmpty(cloudConfigDriveTemplateText))
            {
                Description = Messages.CREATING_CLOUD_CONFIG_DRIVE;

                var parameters = new Dictionary <string, string>();
                parameters.Add("vmuuid", VM.uuid);
                parameters.Add("sruuid", firstSR.uuid);
                parameters.Add("configuration", cloudConfigDriveTemplateText.Replace("\r\n", "\n"));

                var action = new ExecutePluginAction(Connection, HomeServer ?? Helpers.GetMaster(Connection),
                                                     "xscontainer",         //plugin
                                                     "create_config_drive", //function
                                                     parameters,
                                                     true);                 //hidefromlogs

                action.RunExternal(Connection.Session);
                var result = action.Result.Replace("\n", Environment.NewLine);
            }
        }
예제 #3
0
        private void CloudCreateConfigDrive()
        {
            if (Template.TemplateType == XenAPI.VM.VmTemplateType.CoreOS && !string.IsNullOrEmpty(cloudConfigDriveTemplateText))
            {
                Description = "Creating Cloud Config Drive";//Messages.SETTING_VM_PROPERTIES;

                var parameters = new Dictionary<string, string>();
                parameters.Add("vmuuid", VM.uuid);
                parameters.Add("sruuid", firstSR.uuid);
                parameters.Add("configuration", cloudConfigDriveTemplateText.Replace("\r\n", "\n"));

                var action = new ExecutePluginAction(Connection, HomeServer ?? Helpers.GetMaster(Connection),
                            "xscontainer",//plugin
                            "create_config_drive",//function
                            parameters,
                            true); //hidefromlogs

                action.RunExternal(Connection.Session);
                var result = action.Result.Replace("\n", Environment.NewLine);
            }
        }
예제 #4
0
        private void CloudCreateConfigDrive()
        {
            if (Template.CanHaveCloudConfigDrive && !string.IsNullOrEmpty(cloudConfigDriveTemplateText))
            {
                Description = Messages.CREATING_CLOUD_CONFIG_DRIVE;

                var parameters = new Dictionary<string, string>();
                parameters.Add("vmuuid", VM.uuid);
                parameters.Add("sruuid", firstSR.uuid);
                parameters.Add("configuration", cloudConfigDriveTemplateText.Replace("\r\n", "\n"));

                var action = new ExecutePluginAction(Connection, HomeServer ?? Helpers.GetMaster(Connection),
                            "xscontainer",//plugin
                            "create_config_drive",//function
                            parameters,
                            true); //hidefromlogs

                action.RunExternal(Connection.Session);
                var result = action.Result.Replace("\n", Environment.NewLine);
            }
        }