Skip to content

Commit

Permalink
Linux KVM implementation (#157)
Browse files Browse the repository at this point in the history
- Implemented Linux KVM feature.
- JIRA: https://jsw.ibm.com/browse/PFEBMC-1133
- JIRA: https://jsw.ibm.com/browse/PFEBMC-1136

Signed-off-by: Nikhil Ashoka <[email protected]>
  • Loading branch information
Nikhil-Ashoka authored Dec 1, 2023
1 parent c8e1bfd commit 68b0643
Show file tree
Hide file tree
Showing 4 changed files with 271 additions and 6 deletions.
26 changes: 25 additions & 1 deletion src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,8 @@
"powPolicySection": "will be set to %{powerPolicy}",
"powerOff": "Power Off",
"pvm_default_os_type": "Default partition environment",
"pvm_linux_kvm_memory": "Linux KVM",
"pvm_linux_kvm_percentage": "System Memory Reserved for KVM Guest Management (%)",
"pvm_os_boot_type": "IBM i partition boot mode",
"pvm_rpa_boot_mode": "AIX/LINUX partition boot mode",
"pvm_stop_at_standby": "Server firmware start policy",
Expand All @@ -1508,12 +1510,14 @@
"setting": {
"aix": "AIX",
"linux": "Linux",
"linuxKVM": "Linux KVM",
"ibmI": "IBM I",
"default": "Default"
},
"description": {
"aix": "System firmware will select AIX/Linux as default partition environment.",
"linux" : "System firmware will select AIX/Linux as default partition environment.",
"linuxKVM": "System firmware will select Linux KVM as default partition environment.",
"ibmI": "Server firmware will select IBM i as default partition environment.",
"default": "System firmware will automatically select the default partition environment based on system brand type."
}
Expand All @@ -1533,6 +1537,20 @@
"bootToOpenFirware": "The system stops at the open firmware prompt.",
"serviceBootMode": "The system boots from the default boot list. This option is the preferred way to run stand-alone diagnostics from a CD-ROM drive."
}
},
"linuxKvmItems": {
"setting": {
"automatic": "Automatic",
"custom": "Custom"
},
"description": {
"automatic": "The system will determine the percentage of available system memory to be reserved for the management of KVM guests.",
"custom" : "The user specified percentage of available system memory will be reserved for the management of KVM guests."
}
},
"linuxKvmPercentage": {
"description": "Specifies the percentage of available system memory that will be reserved for the management of KVM guests. The percentage is specified to the 10th of a percent.",
"errorMessage": "Value must be in range of 0-100 and include decimals with up to one decimal point."
},
"ibmiItems": {
"setting": {
Expand All @@ -1552,6 +1570,7 @@
"pvm_default_os_type": {
"AIX": "AIX",
"Linux": "Linux",
"Linux KVM": "Linux KVM",
"IBM I": "IBM I",
"Default": "Default"
},
Expand Down Expand Up @@ -1582,6 +1601,10 @@
"automaticHelperText": "With this setting, when the system is not partitioned, the behavior is the same as power off, and when the system is partitioned, the behavior of the system is the same as stay on",
"powerOffHelperText": "When the last partition powers off, the server will power off",
"stayOnHelperText": "When the last partition powers off, the server will stay on"
},
"pvm_linux_kvm_memory": {
"Automatic": "Automatic",
"Custom": "Custom"
}
}
},
Expand All @@ -1596,7 +1619,8 @@
"toast": {
"errorPowerOn": "BMC is not ready to power on the host.",
"errorSaveSettings": "Error saving settings.",
"successSaveSettings": "Successfully saved settings."
"successSaveSettings": "Successfully saved settings.",
"successSaveLinuxKvmSettings": "Successfully saved settings. Changes made will take effect on next reboot."
}
},
"pageServiceLoginConsoles": {
Expand Down
23 changes: 23 additions & 0 deletions src/store/modules/Operations/BootSettingsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ const BootSettingsStore = {
'pvm_rpa_boot_mode',
'pvm_os_boot_type',
'pvm_sys_dump_active',
'pvm_linux_kvm_memory',
],
disabled: false,
attributeValues: null,
automaticRetryConfigValue: '',
biosAttributes: null,
bootFault: '',
powerRestorePolicyValue: '',
linuxKvmPercentageValue: null,
linuxKvmPercentageCurrentValue: null,
},
getters: {
attributeValues: (state) => state.attributeValues,
Expand All @@ -28,6 +31,9 @@ const BootSettingsStore = {
systemDumpActive: (state) =>
state.biosAttributes?.pvm_sys_dump_active === 'Enabled',
disabled: (state) => state.disabled,
linuxKvmPercentageValue: (state) => state.linuxKvmPercentageValue,
linuxKvmPercentageCurrentValue: (state) =>
state.linuxKvmPercentageCurrentValue,
},
mutations: {
setDisabled: (state, disabled) => (state.disabled = disabled),
Expand All @@ -41,6 +47,13 @@ const BootSettingsStore = {
(state.powerRestorePolicyValue = powerRestorePolicyValue),
setAutomaticRetryConfigValue: (state, automaticRetryConfigValue) =>
(state.automaticRetryConfigValue = automaticRetryConfigValue),
setLinuxKvmPercentageValue: (state, linuxKvmPercentageValue) =>
(state.linuxKvmPercentageValue = linuxKvmPercentageValue),
setLinuxKvmPercentageCurrentValue: (
state,
linuxKvmPercentageCurrentValue
) =>
(state.linuxKvmPercentageCurrentValue = linuxKvmPercentageCurrentValue),
},
actions: {
async getOperatingModeSettings({ commit }) {
Expand Down Expand Up @@ -106,6 +119,12 @@ const BootSettingsStore = {
RegistryEntries: { Attributes },
},
}) => {
let linuxPercentObj = Attributes.find(
(itm) => itm.AttributeName === 'pvm_linux_kvm_percentage'
);
let linuxValue = linuxPercentObj?.CurrentValue / 10;
commit('setLinuxKvmPercentageValue', linuxValue);
commit('setLinuxKvmPercentageCurrentValue', linuxValue);
// Array for state BIOS attributes is created
const filteredAttributeValues = state.attributeKeys
.reduce((arr, attriValue) => {
Expand Down Expand Up @@ -134,6 +153,7 @@ const BootSettingsStore = {
'pvm_rpa_boot_mode',
'pvm_stop_at_standby',
'pvm_system_operating_mode',
'pvm_linux_kvm_memory',
].indexOf(attributeObj.AttributeName) >= 0
? i18n.t(
`pageServerPowerOperations.biosSettings.attributeValues.${attributeObj.AttributeName}.${item.ValueName}`
Expand Down Expand Up @@ -200,6 +220,9 @@ const BootSettingsStore = {
return error;
});
},
saveLinuxPercentageValue({ commit }, value) {
commit('setLinuxKvmPercentageValue', value);
},
},
};
export default BootSettingsStore;
Loading

0 comments on commit 68b0643

Please sign in to comment.