Skip to content

feat(xo6): add SR create form - #10251

Open
sylvere-a wants to merge 3 commits into
masterfrom
xo6/sr-create
Open

feat(xo6): add SR create form#10251
sylvere-a wants to merge 3 commits into
masterfrom
xo6/sr-create

Conversation

@sylvere-a

@sylvere-a sylvere-a commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Needs testing on real infrastructure for the following types: ext, lvm, smb, and smbiso ⚠️

Description

[XO 6] Create SR

Added SR creation from the Host and Pool Storage tabs via a new drawer form.

Supported types for this first pass: ext, local, lvm, smb, and smbiso.

SR types that require host probing (e.g. NFS, iSCSI, HBA, ZFS) will be added in a follow-up PR.

Note:
The "Create new SR" button is alone in a dropdown menu for now, but the "Attach existing SR" action will be placed there later.

Screenshots

Light Dark
"Create new SR" button create_sr_light create_sr_dark
"Create new SR" form create_sr_form_light create_sr_form_dark

Testing

Creation of a local SR

  • Go to the Storage tab of any Pool or Host
  • Click New > Create new SR
  • Name: choose a name
  • Access mode: Local
  • Pool: select the desired pool
  • Host: select the pool master
  • Type: ISO SR > Local
  • Path: /test/iso (directory must exist)
  • Click Create

Erase confirm modal

  • Go to the Storage tab of any Pool or Host
  • Click New > Create new SR
  • Name: type anything
  • Access mode: Local
  • Pool: select any pool
  • Host: select any host
  • Type: VDI SR > ext
  • Device: type anything
  • Click Create
  • The Erase confirm modal should appear, dismiss it without validating unless you know what you're doing

@sylvere-a sylvere-a self-assigned this Aug 10, 2026
@sylvere-a
sylvere-a force-pushed the xo6/sr-create branch 3 times, most recently from dadcc69 to a0f1a4b Compare August 10, 2026 17:06
@sylvere-a
sylvere-a requested a review from MarieGarde August 10, 2026 17:08
@sylvere-a
sylvere-a marked this pull request as ready for review August 10, 2026 17:08
Comment thread @xen-orchestra/web/src/modules/storage-repository/form/new/use-new-sr-form.ts Outdated
Comment thread @xen-orchestra/web/src/modules/storage-repository/jobs/xo-sr-create.job.ts Outdated
Comment thread @xen-orchestra/web/src/modules/storage-repository/form/new/sr-form.types.ts Outdated
Comment thread @xen-orchestra/web/src/modules/storage-repository/form/new/use-new-sr-form.ts Outdated
Comment thread @xen-orchestra/web/src/modules/storage-repository/form/new/use-new-sr-form.ts Outdated
Comment thread @xen-orchestra/web/src/modules/storage-repository/jobs/xo-sr-create.job.ts Outdated
@MarieGarde
MarieGarde requested a review from OlivierFL August 13, 2026 12:04
<template #title>{{ t('action:create-sr') }}</template>

<template #content>
<NewStorageRepositoryForm ref="formRef" :pool-id="poolId" :host-id="hostId" />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<NewStorageRepositoryForm ref="formRef" :pool-id="poolId" :host-id="hostId" />
<NewStorageRepositoryForm ref="formRef" :pool-id :host-id />

@@ -0,0 +1,158 @@
<template>
<VtsForm class="new-sr-form">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match the component's name:

Suggested change
<VtsForm class="new-sr-form">
<VtsForm class="new-storage-repository-form">

"host-internal-networks": "Host internal networks",
"host-not-running": "Host not running",
"host-off": "Host is powered off",
"host-required": "@:job:arg:host-required",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be better to reverse the linked message:
host-required become Host is required and job:arg:host-required links to host-required

Comment on lines +1029 to +1033
"sr-type-ext": "ext",
"sr-type-local": "Local",
"sr-type-lvm": "LVM",
"sr-type-smb": "SMB",
"sr-type-smbiso": "SMB ISO",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reusability, these keys could be:

Suggested change
"sr-type-ext": "ext",
"sr-type-local": "Local",
"sr-type-lvm": "LVM",
"sr-type-smb": "SMB",
"sr-type-smbiso": "SMB ISO",
"ext": "ext",
"local": "Local",
"lvm": "LVM",
"smb": "SMB",
"smb-iso": "SMB ISO",

local already exists

"sr-connect-info-pool-shared": "Le SR sera connecté à {hostsCount} hôtes de ce pool. | Chaque SR partagé sera connecté à tous les hôtes de ce pool.",
"sr-connect-title": "Vous êtes sur le point de connecter 1 SR | Vous êtes sur le point de connecter {n} SRs",
"sr-create-erase-confirm": "Cette opération effacera l'intégralité du disque ou de la partition ({device}) pour créer un nouveau SR. Voulez-vous vraiment continuer ?",
"sr-create-erase-confirm-title": "Créer un nouvel SR",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match the other translations:

Suggested change
"sr-create-erase-confirm-title": "Créer un nouvel SR",
"sr-create-erase-confirm-title": "Créer un nouveau SR",

And given the translation becomes the same as action:create-sr, what do you think of using a linked message here?

Comment on lines +140 to +143
requiredIf: withMessage(
requiredIf(() => formData.type === 'lvm' || formData.type === 'ext'),
() => t('form:error:required')
),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
requiredIf: withMessage(
requiredIf(() => formData.type === 'lvm' || formData.type === 'ext'),
() => t('form:error:required')
),
requiredIf: requiredIf(() => formData.type === 'lvm' || formData.type === 'ext'),

Comment on lines +152 to +155
requiredIf: withMessage(
requiredIf(() => formData.type === 'local'),
() => t('form:error:required')
),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
requiredIf: withMessage(
requiredIf(() => formData.type === 'local'),
() => t('form:error:required')
),
requiredIf: requiredIf(() => formData.type === 'local'),

return
}

formData.poolId = pools.value.find(pool => pool.id === contextPoolId.value)?.id

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use getPoolById:

Suggested change
formData.poolId = pools.value.find(pool => pool.id === contextPoolId.value)?.id
formData.poolId = getPoolById(contextPoolId.value)?.id

return
}

const masterHostId = pools.value.find(pool => pool.id === formData.poolId)?.master

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here:

Suggested change
const masterHostId = pools.value.find(pool => pool.id === formData.poolId)?.master
const masterHostId = getPoolById(formData.poolId)?.master

@sylvere-a
sylvere-a requested a review from MarieGarde September 3, 2026 10:09
Comment thread @xen-orchestra/web-core/lib/locales/en.json Outdated
Comment thread @xen-orchestra/web-core/lib/locales/en.json
Comment thread @xen-orchestra/web-core/lib/locales/fr.json
@sylvere-a
sylvere-a requested a review from MarieGarde September 4, 2026 14:05
@MarieGarde
MarieGarde requested a review from OlivierFL September 4, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants