fix(xo-server,xo-web): send version when probing NFS SR

Reported by @benjamreis
This commit is contained in:
Julien Fontanet
2023-07-20 16:46:18 +02:00
parent 18dce3fce6
commit 49c161b17a
4 changed files with 14 additions and 8 deletions
+1
View File
@@ -17,6 +17,7 @@
- [REST API] Fix VDI export when NBD is enabled
- [XO Config Cloud Backup] Improve wording about passphrase (PR [#6938](https://github.com/vatesfr/xen-orchestra/pull/6938))
- [Pool] Fix IPv6 handling when adding hosts
- [New SR] Send provided NFS version to XAPI when probing a share
### Packages to release
+6 -2
View File
@@ -467,10 +467,11 @@ createZfs.resolve = {
// This function helps to detect all NFS shares (exports) on a NFS server
// Return a table of exports with their paths and ACLs
export async function probeNfs({ host, server }) {
export async function probeNfs({ host, nfsVersion, server }) {
const xapi = this.getXapi(host)
const deviceConfig = {
nfsversion: nfsVersion,
server,
}
@@ -501,6 +502,7 @@ export async function probeNfs({ host, server }) {
probeNfs.params = {
host: { type: 'string' },
nfsVersion: { type: 'string', optional: true },
server: { type: 'string' },
}
@@ -837,10 +839,11 @@ probeHbaExists.resolve = {
// This function helps to detect if this NFS SR already exists in XAPI
// It returns a table of SR UUID, empty if no existing connections
export async function probeNfsExists({ host, server, serverPath }) {
export async function probeNfsExists({ host, nfsVersion, server, serverPath }) {
const xapi = this.getXapi(host)
const deviceConfig = {
nfsversion: nfsVersion,
server,
serverpath: serverPath,
}
@@ -859,6 +862,7 @@ export async function probeNfsExists({ host, server, serverPath }) {
probeNfsExists.params = {
host: { type: 'string' },
nfsVersion: { type: 'string', optional: true },
server: { type: 'string' },
serverPath: { type: 'string' },
}
+3 -2
View File
@@ -2693,9 +2693,10 @@ export const fetchFiles = (remote, disk, partition, paths) =>
// -------------------------------------------------------------------
export const probeSrNfs = (host, server) => _call('sr.probeNfs', { host, server })
export const probeSrNfs = (host, server, nfsVersion) => _call('sr.probeNfs', { host, nfsVersion, server })
export const probeSrNfsExists = (host, server, serverPath) => _call('sr.probeNfsExists', { host, server, serverPath })
export const probeSrNfsExists = (host, server, serverPath, nfsVersion) =>
_call('sr.probeNfsExists', { host, nfsVersion, server, serverPath })
export const probeSrIscsiIqns = (host, target, port = undefined, chapUser = undefined, chapPassword) => {
const params = { host, target }
+4 -4
View File
@@ -467,11 +467,11 @@ export default class New extends Component {
_handleSearchServer = async () => {
const { password, port, server, username } = this.refs
const { host, type } = this.state
const { host, nfsVersion, type } = this.state
try {
if (type === 'nfs' || type === 'nfsiso') {
const paths = await probeSrNfs(host.id, server.value)
const paths = await probeSrNfs(host.id, server.value, nfsVersion !== '' ? nfsVersion : undefined)
this.setState({
usage: undefined,
paths,
@@ -500,12 +500,12 @@ export default class New extends Component {
_handleSrPathSelection = async path => {
const { server } = this.refs
const { host } = this.state
const { host, nfsVersion } = this.state
try {
this.setState(({ loading }) => ({ loading: loading + 1 }))
this.setState({
existingSrs: await probeSrNfsExists(host.id, server.value, path),
existingSrs: await probeSrNfsExists(host.id, server.value, path, nfsVersion !== '' ? nfsVersion : undefined),
path,
usage: true,
summary: true,