Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions libs/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,8 @@
"Configuration mode": "Configuration mode",
"Form": "Form",
"Use Form for standard Linux VMs. Use YAML for advanced configurations such as Windows VMs or custom KubeVirt setups that require additional spec fields.": "Use Form for standard Linux VMs. Use YAML for advanced configurations such as Windows VMs or custom KubeVirt setups that require additional spec fields.",
"VM restart notice": "VM restart notice",
"Updating the VM configuration will restart existing virtual machine applications. Cloud-init user data and credentials are reapplied when the VM boots.": "Updating the VM configuration will restart existing virtual machine applications. Cloud-init user data and credentials are reapplied when the VM boots.",
"Advanced YAML configuration detected": "Advanced YAML configuration detected",
"This VM uses settings that are not supported in form view. YAML mode is selected to preserve the full configuration. Editing in form view may overwrite these custom settings.": "This VM uses settings that are not supported in form view. YAML mode is selected to preserve the full configuration. Editing in form view may overwrite these custom settings.",
"Disk image (OCI)": "Disk image (OCI)",
Expand All @@ -874,9 +876,9 @@
"Memory allocated to the VM using KubeVirt units. Examples: \"2Gi\", \"512Mi\", \"4294967296\".": "Memory allocated to the VM using KubeVirt units. Examples: \"2Gi\", \"512Mi\", \"4294967296\".",
"Provide a valid KubeVirt memory value (e.g., \"2Gi\", \"512Mi\", \"4294967296\").": "Provide a valid KubeVirt memory value (e.g., \"2Gi\", \"512Mi\", \"4294967296\").",
"Cloud-init user data": "Cloud-init user data",
"Cloud-init user data in YAML format. Applied on first boot only. SSH key and password entries in this field are managed by the Credentials section below and may be overwritten when toggling those options.": "Cloud-init user data in YAML format. Applied on first boot only. SSH key and password entries in this field are managed by the Credentials section below and may be overwritten when toggling those options.",
"Cloud-init user data in YAML format. SSH key and password entries in this field are managed by the Credentials section below and may be overwritten when toggling those options.": "Cloud-init user data in YAML format. SSH key and password entries in this field are managed by the Credentials section below and may be overwritten when toggling those options.",
"Credentials": "Credentials",
"Credentials are applied through cloud-init on first boot only. Changes here will take effect on newly created VMs but will not update VMs already running on existing devices. To update credentials on a running VM, access it directly through the console.": "Credentials are applied through cloud-init on first boot only. Changes here will take effect on newly created VMs but will not update VMs already running on existing devices. To update credentials on a running VM, access it directly through the console.",
"Credentials are written into the cloud-init user data above.": "Credentials are written into the cloud-init user data above.",
"SSH public key": "SSH public key",
"Add a public SSH key to enable direct SSH access to the application's VM. Requires publishing the SSH port to the host device.": "Add a public SSH key to enable direct SSH access to the application's VM. Requires publishing the SSH port to the host device.",
"Password": "Password",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ const createDefaultVmAppForm = (name: string = ''): VmAppForm => ({
specType: AppSpecType.INLINE,
name,
configMode: 'form',
isExisting: false,
hasAdvancedVmSettings: false,
vmYaml: '',
diskImage: '',
Expand Down Expand Up @@ -680,6 +681,7 @@ const toVmAppForm = (vmApp: VmApplication | undefined): VmAppForm => {
...defaults,
name: vmApp.name || '',
configMode,
isExisting: true,
hasAdvancedVmSettings: hasAdvanced,
vmYaml,
diskImage: parsed?.diskImage || defaults.diskImage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ const ApplicationVmForm = ({ index, isReadOnly }: { index: number; isReadOnly?:
</HelperText>
</FormGroup>

{app.isExisting && (
<Alert isInline variant="warning" title={t('VM restart notice')}>
{t(
'Updating the VM configuration will restart existing virtual machine applications. Cloud-init user data and credentials are reapplied when the VM boots.',
)}
</Alert>
)}

{app.configMode === 'yaml' && app.hasAdvancedVmSettings && (
<Alert isInline variant="warning" title={t('Advanced YAML configuration detected')}>
{t(
Expand Down Expand Up @@ -257,16 +265,14 @@ const ApplicationVmForm = ({ index, isReadOnly }: { index: number; isReadOnly?:
minHeight="auto"
isDisabled={isReadOnly}
helperText={t(
'Cloud-init user data in YAML format. Applied on first boot only. SSH key and password entries in this field are managed by the Credentials section below and may be overwritten when toggling those options.',
'Cloud-init user data in YAML format. SSH key and password entries in this field are managed by the Credentials section below and may be overwritten when toggling those options.',
)}
onChangeCustom={handleCloudInitCustom}
/>

<FormSection title={t('Credentials')}>
<Content component={ContentVariants.small}>
{t(
'Credentials are applied through cloud-init on first boot only. Changes here will take effect on newly created VMs but will not update VMs already running on existing devices. To update credentials on a running VM, access it directly through the console.',
)}
{t('Credentials are written into the cloud-init user data above.')}
</Content>

<SwitchField
Expand Down
2 changes: 2 additions & 0 deletions libs/ui-components/src/types/deviceSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export type VmAppForm = {
configMode: VmConfigMode;
// Full vm.yaml file that can be edited in YAML mode; independent from form field
vmYaml: string;
// Whether this app was loaded from an existing device/fleet spec (not newly added in the form).
isExisting: boolean;
// Whether vm.yaml has settings which are not supported by the guided form.
// Only meaningful for existing applications.
hasAdvancedVmSettings: boolean;
Expand Down
Loading