Skip to content

Commit

Permalink
Add additional-guest-memory-overhead-ratio setting
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <andy.lee@suse.com>
  • Loading branch information
a110605 committed Sep 13, 2024
1 parent cb5f45f commit 0ca5f59
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script>
import CreateEditView from '@shell/mixins/create-edit-view';
import { LabeledInput } from '@components/Form/LabeledInput';
export default {
name: 'AdditionalGuestMemoryOverheadRatio',
components: { LabeledInput },
mixins: [CreateEditView],
data() {
return { ratio: this.value.value || this.value.default };
},
methods: {
update() {
this.$set(this.value, 'value', this.ratio);
},
useDefault() {
this.$set(this, 'ratio', this.value.default);
this.update();
},
},
};
</script>

<template>
<div class="row">
<div class="col span-12">
<LabeledInput
v-model="ratio"
:label="t('harvester.setting.ratio')"
@input="update"
/>
</div>
</div>
</template>
6 changes: 4 additions & 2 deletions pkg/harvester/config/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const HCI_SETTING = {
AUTO_ROTATE_RKE2_CERTS: 'auto-rotate-rke2-certs',
KUBECONFIG_DEFAULT_TOKEN_TTL_MINUTES: 'kubeconfig-default-token-ttl-minutes',
LONGHORN_V2_DATA_ENGINE_ENABLED: 'longhorn-v2-data-engine-enabled',
ADDITIONAL_GUEST_MEMORY_OVERHEAD_RATIO: 'additional-guest-memory-overhead-ratio'
};

export const HCI_ALLOWED_SETTINGS = {
Expand Down Expand Up @@ -83,8 +84,9 @@ export const HCI_ALLOWED_SETTINGS = {
[HCI_SETTING.NTP_SERVERS]: {
kind: 'json', from: 'import', canReset: true
},
[HCI_SETTING.KUBECONFIG_DEFAULT_TOKEN_TTL_MINUTES]: {},
[HCI_SETTING.LONGHORN_V2_DATA_ENGINE_ENABLED]: { kind: 'boolean', technicalPreview: true },
[HCI_SETTING.KUBECONFIG_DEFAULT_TOKEN_TTL_MINUTES]: {},
[HCI_SETTING.LONGHORN_V2_DATA_ENGINE_ENABLED]: { kind: 'boolean', technicalPreview: true },
[HCI_SETTING.ADDITIONAL_GUEST_MEMORY_OVERHEAD_RATIO]: { kind: 'string', from: 'import' },
};

export const HCI_SINGLE_CLUSTER_ALLOWED_SETTING = {
Expand Down
2 changes: 2 additions & 0 deletions pkg/harvester/l10n/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ harvester:
tip: 'Specify an IP range in the IPv4 CIDR format. <code>Number of IPs Required = Number of Nodes * 4 + Number of Disks * 2 + Number of Images to Download/Upload </code>. For more information about storage network settings, see the <a href="{url}" target="_blank">documentation</a>.'
vmForceDeletionPolicy:
period: Period
ratio : Ratio
autoRotateRKE2Certs:
expiringInHours: Expiring in
httpProxy:
Expand Down Expand Up @@ -1396,6 +1397,7 @@ advancedSettings:
'harv-auto-rotate-rke2-certs': The certificate rotation mechanism relies on Rancher. Harvester will automatically update certificates generation to trigger rotation.
'harv-kubeconfig-default-token-ttl-minutes': 'TTL (in minutes) applied on Harvester administration kubeconfig files. Default is 0, which means to never expire.'
'harv-longhorn-v2-data-engine-enabled': 'Enable the Longhorn V2 data engine. Default is false. <ul><li>Changing this setting will restart RKE2 on all nodes. This will not affect running VM workloads.</li><li>If you see "not enough hugepages-2Mi capacity" errors when enabling this setting, wait a minute for the error to clear. If the error remains, reboot the affected node.</li></ul>'
'harv-additional-guest-memory-overhead-ratio': 'The ratio for kubevirt to adjust the VM overhead memory. The value could be zero, empty value or floating number between 1.0 and 10.0, default to 1.5.'

typeLabel:
kubevirt.io.virtualmachine: |-
Expand Down

0 comments on commit 0ca5f59

Please sign in to comment.