Skip to content

Commit 68b0643

Browse files
Linux KVM implementation (#157)
- 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]>
1 parent c8e1bfd commit 68b0643

File tree

4 files changed

+271
-6
lines changed

4 files changed

+271
-6
lines changed

src/locales/en-US.json

+25-1
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,8 @@
14821482
"powPolicySection": "will be set to %{powerPolicy}",
14831483
"powerOff": "Power Off",
14841484
"pvm_default_os_type": "Default partition environment",
1485+
"pvm_linux_kvm_memory": "Linux KVM",
1486+
"pvm_linux_kvm_percentage": "System Memory Reserved for KVM Guest Management (%)",
14851487
"pvm_os_boot_type": "IBM i partition boot mode",
14861488
"pvm_rpa_boot_mode": "AIX/LINUX partition boot mode",
14871489
"pvm_stop_at_standby": "Server firmware start policy",
@@ -1508,12 +1510,14 @@
15081510
"setting": {
15091511
"aix": "AIX",
15101512
"linux": "Linux",
1513+
"linuxKVM": "Linux KVM",
15111514
"ibmI": "IBM I",
15121515
"default": "Default"
15131516
},
15141517
"description": {
15151518
"aix": "System firmware will select AIX/Linux as default partition environment.",
15161519
"linux" : "System firmware will select AIX/Linux as default partition environment.",
1520+
"linuxKVM": "System firmware will select Linux KVM as default partition environment.",
15171521
"ibmI": "Server firmware will select IBM i as default partition environment.",
15181522
"default": "System firmware will automatically select the default partition environment based on system brand type."
15191523
}
@@ -1533,6 +1537,20 @@
15331537
"bootToOpenFirware": "The system stops at the open firmware prompt.",
15341538
"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."
15351539
}
1540+
},
1541+
"linuxKvmItems": {
1542+
"setting": {
1543+
"automatic": "Automatic",
1544+
"custom": "Custom"
1545+
},
1546+
"description": {
1547+
"automatic": "The system will determine the percentage of available system memory to be reserved for the management of KVM guests.",
1548+
"custom" : "The user specified percentage of available system memory will be reserved for the management of KVM guests."
1549+
}
1550+
},
1551+
"linuxKvmPercentage": {
1552+
"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.",
1553+
"errorMessage": "Value must be in range of 0-100 and include decimals with up to one decimal point."
15361554
},
15371555
"ibmiItems": {
15381556
"setting": {
@@ -1552,6 +1570,7 @@
15521570
"pvm_default_os_type": {
15531571
"AIX": "AIX",
15541572
"Linux": "Linux",
1573+
"Linux KVM": "Linux KVM",
15551574
"IBM I": "IBM I",
15561575
"Default": "Default"
15571576
},
@@ -1582,6 +1601,10 @@
15821601
"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",
15831602
"powerOffHelperText": "When the last partition powers off, the server will power off",
15841603
"stayOnHelperText": "When the last partition powers off, the server will stay on"
1604+
},
1605+
"pvm_linux_kvm_memory": {
1606+
"Automatic": "Automatic",
1607+
"Custom": "Custom"
15851608
}
15861609
}
15871610
},
@@ -1596,7 +1619,8 @@
15961619
"toast": {
15971620
"errorPowerOn": "BMC is not ready to power on the host.",
15981621
"errorSaveSettings": "Error saving settings.",
1599-
"successSaveSettings": "Successfully saved settings."
1622+
"successSaveSettings": "Successfully saved settings.",
1623+
"successSaveLinuxKvmSettings": "Successfully saved settings. Changes made will take effect on next reboot."
16001624
}
16011625
},
16021626
"pageServiceLoginConsoles": {

src/store/modules/Operations/BootSettingsStore.js

+23
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ const BootSettingsStore = {
1111
'pvm_rpa_boot_mode',
1212
'pvm_os_boot_type',
1313
'pvm_sys_dump_active',
14+
'pvm_linux_kvm_memory',
1415
],
1516
disabled: false,
1617
attributeValues: null,
1718
automaticRetryConfigValue: '',
1819
biosAttributes: null,
1920
bootFault: '',
2021
powerRestorePolicyValue: '',
22+
linuxKvmPercentageValue: null,
23+
linuxKvmPercentageCurrentValue: null,
2124
},
2225
getters: {
2326
attributeValues: (state) => state.attributeValues,
@@ -28,6 +31,9 @@ const BootSettingsStore = {
2831
systemDumpActive: (state) =>
2932
state.biosAttributes?.pvm_sys_dump_active === 'Enabled',
3033
disabled: (state) => state.disabled,
34+
linuxKvmPercentageValue: (state) => state.linuxKvmPercentageValue,
35+
linuxKvmPercentageCurrentValue: (state) =>
36+
state.linuxKvmPercentageCurrentValue,
3137
},
3238
mutations: {
3339
setDisabled: (state, disabled) => (state.disabled = disabled),
@@ -41,6 +47,13 @@ const BootSettingsStore = {
4147
(state.powerRestorePolicyValue = powerRestorePolicyValue),
4248
setAutomaticRetryConfigValue: (state, automaticRetryConfigValue) =>
4349
(state.automaticRetryConfigValue = automaticRetryConfigValue),
50+
setLinuxKvmPercentageValue: (state, linuxKvmPercentageValue) =>
51+
(state.linuxKvmPercentageValue = linuxKvmPercentageValue),
52+
setLinuxKvmPercentageCurrentValue: (
53+
state,
54+
linuxKvmPercentageCurrentValue
55+
) =>
56+
(state.linuxKvmPercentageCurrentValue = linuxKvmPercentageCurrentValue),
4457
},
4558
actions: {
4659
async getOperatingModeSettings({ commit }) {
@@ -106,6 +119,12 @@ const BootSettingsStore = {
106119
RegistryEntries: { Attributes },
107120
},
108121
}) => {
122+
let linuxPercentObj = Attributes.find(
123+
(itm) => itm.AttributeName === 'pvm_linux_kvm_percentage'
124+
);
125+
let linuxValue = linuxPercentObj?.CurrentValue / 10;
126+
commit('setLinuxKvmPercentageValue', linuxValue);
127+
commit('setLinuxKvmPercentageCurrentValue', linuxValue);
109128
// Array for state BIOS attributes is created
110129
const filteredAttributeValues = state.attributeKeys
111130
.reduce((arr, attriValue) => {
@@ -134,6 +153,7 @@ const BootSettingsStore = {
134153
'pvm_rpa_boot_mode',
135154
'pvm_stop_at_standby',
136155
'pvm_system_operating_mode',
156+
'pvm_linux_kvm_memory',
137157
].indexOf(attributeObj.AttributeName) >= 0
138158
? i18n.t(
139159
`pageServerPowerOperations.biosSettings.attributeValues.${attributeObj.AttributeName}.${item.ValueName}`
@@ -200,6 +220,9 @@ const BootSettingsStore = {
200220
return error;
201221
});
202222
},
223+
saveLinuxPercentageValue({ commit }, value) {
224+
commit('setLinuxKvmPercentageValue', value);
225+
},
203226
},
204227
};
205228
export default BootSettingsStore;

0 commit comments

Comments
 (0)