XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Shares 0
    • Posts 10
    • Groups 0
    F Offline
    1. Home
    2. frb94

    frb94

    @frb94

    4
    Reputation
    2
    Profile views
    10
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    frb94 Unfollow Follow
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @poddingue Hello, i added my part regarding both disable-remote and umount -l

      Just as an update for everyone. This nfs behaviour was driving me crazy so i decided to go back to veeam community edition as my backup solution.

      Now XO does only metadata backup on a local folder, then veeam covers everything, XO included.

      What i've lost

      • Fully integrated solution
      • Easy management with tagging
      • Very low resource use

      What i've gained

      • Significantly less storage space used on the backup repo
      • Easy to identify backup files (no uuid)
      • Two additional vm to manage (veeam + veeam worker)

      It's not as complete as it was with vmware, for obvious reasons, but i have to say Vates and Veeam did an amazing job. Looking forward for application aware processing !!

      posted in Xen Orchestra
      F
      frb94
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @poddingue @florent

      I really do not want to look like i'm not appreciating the platform. I am a sysadmin currently evaluating XCP-ng and Xen Orchestra as a replacement for VMware, and I have to say this issue is making me a bit concerned. Of course for now it's my homelab, but it is already a show stopper for me.

      I understand that NFS hard mounts can block when the server goes offline, but I really wouldn't expect an unavailable backup repository to make the entire XO Web UI unresponsive, especially when no backup jobs are running.

      To me, this feels like vCenter becoming unusable just because one of the backup repositories is down. That's a pretty big deal in a production environment. Also, i have not yet tested what happens to vms running on local SR and management plane of a host when the main NFS SR may become unavailable.

      What worries me even more is that, as my tests showed, once XO gets stuck, even SIGKILL can't terminate the process, so recovering isn't straightforward either.

      Am I missing something here? Is there something wrong with my setup, or is this actually expected behavior?

      I really like XCP-ng and XO so far, but I'm trying to understand how companies handle this kind of situation in production. Surely a failed backup destination shouldn't take down the whole management interface?

      posted in Xen Orchestra
      F
      frb94
    • [Bug?] Load Balancer: Performance mode fails to power on hosts previously shut down by Density mode

      [Bug?] Load Balancer: Performance mode fails to power on hosts previously shut down by Density mode

      Hi everyone,

      I'm experiencing a possible bug with the Xen Orchestra Load Balancer plugin when switching from Density to Performance mode.

      Density successfully consolidates VMs and shuts down an unused host, but switching back to Performance does not automatically power that host on, even though Wake-on-LAN is correctly configured and works manually.

      After investigating the source code, I suspect that the host filtering logic prevents Performance mode from detecting hosts that were disabled during shutdown.

      Environment

      • Xen Orchestra: Built from source
      • Build: (November 10, 2026) Xen Orchestra, commit 03e93 | Master, commit 83c3e
      • Plugin: xo-server-load-balancer
      • Storage: Shared storage, live VM migrations working
      • Power-on method: Wake-on-LAN

      The pool contains three hosts:

      Host Role Load Balancer configuration
      XCPNG1 Additional host Excluded from the plan
      XCPNG2 Pool Master Always running
      XCPNG3 Secondary host Managed by Load Balancer

      Xen Orchestra itself runs as a VM on the Pool Master (XCPNG2).

      Steps to reproduce

      1. Start XCPNG2 and XCPNG3.
      2. Set the Load Balancer plan to Performance.
      3. Plugin distributes VMs between both hosts (approximately 50/50).
      4. Switch the plan to Density.
      5. Density successfully migrates the VMs from XCPNG3 to XCPNG2 and automatically shuts down XCPNG3.
      6. Switch the same plan back to Performance.
      7. Save the configuration and wait for multiple Load Balancer execution cycles.

      Expected behavior

      According to the official Xen Orchestra Load Balancing documentation, Performance mode should automatically power on halted hosts when a power-on mode is configured.

      XCPNG3 should therefore power on automatically.

      Actual behavior

      XCPNG3 remains powered off.

      No automatic power-on occurs.

      However, clicking the Play / Power on button for XCPNG3 in the Xen Orchestra UI successfully starts the host.

      The issue does not appear to be related to Wake-on-LAN connectivity.

      Load Balancer configuration

      • Mode: Performance
      • Performance behavior: Conservative
      • CPU critical threshold: 90%
      • RAM free critical threshold: 10000 MB
      • Migration cooldown: 1 minute
      • Maximum concurrent migrations: 1
      • Excluded hosts: XCPNG1

      The same pool and plan work correctly in Density mode.

      Investigation

      1. XAPI power-on mode is configured

      Running the following command on the Pool Master:

      xe host-list params=name-label,uuid,power-on-mode
      

      Returns:

      XCPNG3
      power-on-mode: wake-on-lan
      
      XCPNG1
      power-on-mode: wake-on-lan
      
      XCPNG2
      power-on-mode: wake-on-lan
      

      2. XCPNG3 is disabled after Density shuts it down

      Running:

      xe host-list \
        uuid=dd2cec0b-7849-412e-a040-e2826c35c6cc \
        params=name-label,enabled,power-on-mode
      

      Returns:

      name-label    : XCPNG3
      enabled       : false
      power-on-mode : wake-on-lan
      

      3. Performance mode attempts to power on halted hosts

      In:

      packages/xo-server-load-balancer/src/performance-plan.js

      The execute() method begins with:

      async execute() {
        // Try to power on a hosts set.
        try {
          await Promise.all(
            filter(
              this._getHosts({ powerState: 'Halted' }),
              host => host.powerOnMode !== ''
            ).map(host => {
              const { id } = host
              return this.xo.getXapi(id).powerOnHost(id)
            })
          )
        } catch (error) {
          console.error(error)
        }
      }
      

      This suggests that Performance should attempt to power on halted hosts independently of CPU/RAM thresholds or migration cooldown.

      4. Potential issue in _getHosts()

      In:

      packages/xo-server-load-balancer/src/plan.js

      Lines 256–265:

      _getHosts({ powerState = 'Running' } = {}) {
        return filter(
          this.xo.getObjects(),
          object =>
            object.type === 'host' &&
            includes(this._poolIds, object.$poolId) &&
            object.power_state === powerState &&
            !includes(this._excludedHosts, object.id) &&
            object.enabled === true
        )
      }
      
      object.enabled === true
      

      If a halted host has enabled: false, _getHosts({ powerState: 'Halted' }) appears to exclude it before Performance can call powerOnHost().

      5. Density uses shutdownHost()

      In:

      packages/xo-server-load-balancer/src/density-plan.js

      debug(`Shutdown Host (${fmtSrcHost}).`)
      
      try {
        await xapiSrc.shutdownHost(srcHost.id)
      } catch (error) {
        debug(`Unable to shutdown Host (${fmtSrcHost}).`, { error })
      }
      

      The underlying implementation in:

      packages/xo-server/src/xapi/index.mjs

      Contains:

      async shutdownHost(hostId, { force = false, bypassEvacuate = false } = {}) {
        const host = this.getObject(hostId)
        if (bypassEvacuate) {
          await this.call('host.disable', host.$ref)
        } else {
          await this.clearHost(host, force)
        }
        await this.callAsync('host.shutdown', host.$ref)
      }
      

      This is consistent with the observation that XCPNG3 ends up with enabled: false after being shut down by Density.

      Suspected root cause

      My hypothesis is:

      1. Density evacuates XCPNG3.
      2. Density calls shutdownHost().
      3. XCPNG3 becomes halted and disabled (enabled: false).
      4. Performance calls _getHosts({ powerState: 'Halted' }).
      5. _getHosts() filters out XCPNG3 because enabled !== true.
      6. powerOnHost() is never called for XCPNG3.

      This would explain why manual power-on through the Xen Orchestra UI works while automatic power-on through the Load Balancer does not.

      Possible fix

      Would it make sense to allow disabled hosts to be returned by _getHosts() only when searching for halted hosts to power on?

      For example, the condition:

      object.enabled === true
      

      could potentially become:

      (powerState === 'Halted' || object.enabled === true)
      

      Questions

      1. Is this a known issue in the current Load Balancer implementation?
      2. Is enabled: false expected after Density shuts down a host?
      3. Should Performance be able to restart a host in this state?
      4. Is the enabled === true filter intentional for halted hosts?
      5. Is there an existing workaround or an upstream fix?

      The goal is to use Density at night to consolidate VMs and shut down unused hosts, then switch to Performance during the day to bring those hosts back online automatically.

      Thanks in advance for any insights!

      posted in Xen Orchestra
      F
      frb94
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @acebmxer So what are you doing now? Given the manual, NFS is the way, but i can't have the remote available h24 and also i would like to have a functioning XO 😀

      posted in Xen Orchestra
      F
      frb94
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @poddingue Hello, i added my part regarding both disable-remote and umount -l

      Just as an update for everyone. This nfs behaviour was driving me crazy so i decided to go back to veeam community edition as my backup solution.

      Now XO does only metadata backup on a local folder, then veeam covers everything, XO included.

      What i've lost

      • Fully integrated solution
      • Easy management with tagging
      • Very low resource use

      What i've gained

      • Significantly less storage space used on the backup repo
      • Easy to identify backup files (no uuid)
      • Two additional vm to manage (veeam + veeam worker)

      It's not as complete as it was with vmware, for obvious reasons, but i have to say Vates and Veeam did an amazing job. Looking forward for application aware processing !!

      posted in Xen Orchestra
      F
      frb94
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @acebmxer that is exactley what i was saying before. if you disable the remote before nas shutdown you are good on the XO side and will work indefinitely, but if you don't execute

      umount -l /run/xo-server/mounts/2ab02323-0d47-43a5-9081-b2454e036c70
      

      you will have the mount stuck on the os side. You will be able to reboot XO vm eventually but you will have to wait for a long timeout during XO shutdown.

      if you want to simulate my issue just disable the remote 5 minutes after shutting down the synology, get the pid from

      service xo-server status
      

      then

      ps -T pid
      

      after a while you'll have 4 "rpc_wait_bit_killable" and XO will stop responding

      posted in Xen Orchestra
      F
      frb94
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @acebmxer Hello, no. Let me describe my setup.

      Esxi + vcenter + veeam. Vcenter wakes up veaam at 9am. Veeam sends wol packet to the synology nas at 9.15. At 9.30 the backup starts and ends more or less at 10.00
      Due to inactivity synology stops the hard disks, then after some time it shut itself off. Veeam just see the repo as unavailable. At 12.00 veeam auto shuts down.

      Migrating to xcpng + xo, veeam is retired. At first i added the remote to XO, believing it's like veeam. If the backend goes down it simply shows unavailable. Then i discovered is not at all like that when i found an inaccessible XO. After some chatgpt-ing i found out this "bug". I thought that the script would be sufficient, but it's not. Waiting for ping to fail and then disable the remote (cron every 5mins) still ends up in

      ps -T -p 738 -o pid,tid,stat,wchan:32,comm
          PID     TID STAT WCHAN                            COMMAND
          738     738 Ssl  do_epoll_wait                    MainThread
          738     753 Ssl  do_epoll_wait                    DelayedTaskSche
          738     754 Ssl  futex_wait_queue                 V8Worker
          738     755 Ssl  futex_wait_queue                 V8Worker
          738     756 Ssl  futex_wait_queue                 V8Worker
          738     757 Ssl  futex_wait_queue                 V8Worker
          738     758 Ssl  futex_wait_queue                 SignalInspector
          738     863 Dsl  rpc_wait_bit_killable            libuv-worker
          738     864 Dsl  rpc_wait_bit_killable            libuv-worker
          738     865 Dsl  rpc_wait_bit_killable            libuv-worker
          738     866 Dsl  rpc_wait_bit_killable            libuv-worker
      

      And it's even worse because not only XO becomes unavailable, but even if i disable manually (or via script) the remote as soon as the backup ends, with the synology still ON, the linux os does not unmount the nfs.
      Today the remote was disabled before the nas shutdown and correctly XO kept working. But if at this point i want to restart the XO vm i must do this before shutdown

      umount -l /run/xo-server/mounts/9fc232df-4d0c-4a15-93b5-c0585c1dd9c9
      

      otherwise it stays like this for at least 15 minutes, then finally reboots

      image.jpeg

      The ideal behaviour would be that XO does all by itself, but since we can't have it all, the closest thing i have in mind is

      • Script that sends WOL to the nas, when it pings than enables the remote
      • Script that monitors the backup acrivity. when the last job is done, it must disable the remote and also umount the linux os nfs mount.

      Then the nas could shut down automatically without issue.

      Since i'm not a dev i need to take my time with chatgpt and see i what i can do.

      Having said that, my concern is not about my homelab, it's about production. In my environment i can and want to simulate all kinds of malfuncions. In the previous message i said i still need to try to shut down the main nfs SR for vms and see how the host behaves.
      But if i decide to deploy XEN at my company, i cant have 1 remote unavailability cause the whole XO (or XOA in that case) fall apart.

      Hope it helps!!

      posted in Xen Orchestra
      F
      frb94
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @poddingue @florent

      I really do not want to look like i'm not appreciating the platform. I am a sysadmin currently evaluating XCP-ng and Xen Orchestra as a replacement for VMware, and I have to say this issue is making me a bit concerned. Of course for now it's my homelab, but it is already a show stopper for me.

      I understand that NFS hard mounts can block when the server goes offline, but I really wouldn't expect an unavailable backup repository to make the entire XO Web UI unresponsive, especially when no backup jobs are running.

      To me, this feels like vCenter becoming unusable just because one of the backup repositories is down. That's a pretty big deal in a production environment. Also, i have not yet tested what happens to vms running on local SR and management plane of a host when the main NFS SR may become unavailable.

      What worries me even more is that, as my tests showed, once XO gets stuck, even SIGKILL can't terminate the process, so recovering isn't straightforward either.

      Am I missing something here? Is there something wrong with my setup, or is this actually expected behavior?

      I really like XCP-ng and XO so far, but I'm trying to understand how companies handle this kind of situation in production. Surely a failed backup destination shouldn't take down the whole management interface?

      posted in Xen Orchestra
      F
      frb94
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @florent

      I performed another test to reproduce the issue and evaluate the recovery mechanism introduced in PR #10587.

      Unfortunately, I encountered a limitation that may prevent the new disable-remote command from being used in the exact failure scenario it is intended to address.

      1. Reproducing the issue

      With the NFS remote enabled, I shut down the NAS.

      Initially, Xen Orchestra remained accessible, but one libuv worker became blocked in rpc_wait_bit_killable.

      After some time, all four libuv workers were blocked:

      TID  STAT  WCHAN                    COMMAND
      863  Dsl   rpc_wait_bit_killable    libuv-worker
      864  Dsl   rpc_wait_bit_killable    libuv-worker
      865  Dsl   rpc_wait_bit_killable    libuv-worker
      866  Dsl   rpc_wait_bit_killable    libuv-worker
      

      The xo-server process was still running, but the libuv worker pool was completely blocked.

      I also observed multiple df -kP processes attempting to access the unavailable NFS mount.

      2. Attempting to stop xo-server

      I then executed:

      systemctl stop xo-server
      

      However, systemd was unable to terminate the service, even after sending SIGKILL.

      The final status was:

      Active: failed (Result: timeout)
      Main PID: 738
      
      Processes still around after SIGKILL. Ignoring.
      State 'final-sigterm' timed out. Killing.
      Killing process 738 (MainThread) with signal SIGKILL.
      Processes still around after final SIGKILL. Entering failed mode.
      Unit process 738 (MainThread) remains running after unit stopped.
      

      Checking the remaining process:

      ps -p 738 -o pid,ppid,stat,wchan:32,comm
      

      Returned:

      PID  PPID  STAT  WCHAN                    COMMAND
      738     1  Ds    rpc_wait_bit_killable    MainThread
      

      All other Node.js threads had disappeared, but the main thread remained stuck in an uninterruptible kernel wait.

      3. Attempting a lazy unmount

      I then tried:

      umount -l /run/xo-server/mounts/9fc232df-4d0c-4a15-93b5-c0585c1dd9c9
      

      The command completed successfully, and findmnt -t nfs,nfs4 no longer showed the NFS mount.

      However, the Node.js process remained blocked:

      PID  STAT  WCHAN                    COMMAND
      738  Ds    rpc_wait_bit_killable    MainThread
      

      Therefore, detaching the NFS mount did not release the already pending kernel operation.

      4. Implications for PR #10587

      As I understand it, the new xo-server-db disable-remote <id> command is intended to be executed while xo-server is stopped.

      However, this test shows that when an NFS hard remote becomes unavailable:

      1. All four libuv workers can become blocked.
      2. xo-server becomes unresponsive.
      3. systemctl stop xo-server can fail, even after SIGKILL.
      4. The Node.js process can remain stuck in an uninterruptible kernel wait.
      5. Even umount -l does not necessarily release the blocked process.

      5. Question about the intended recovery procedure

      If xo-server cannot be fully stopped because its process remains stuck in state D, how is the new disable-remote command expected to be used safely?

      Is the intended procedure to execute the database command while the old Node.js process is still present but systemd reports the service as failed?

      Or is a VM reboot / restoration of NFS connectivity still required before the recovery command can be used?

      I have not executed disable-remote in this condition yet, because the original Node.js process is still present and I wanted to avoid modifying the database while it might still be in use.

      My concern is that the new CLI provides a way to prevent the problematic remote from being accessed on the next startup, but does not necessarily provide a complete recovery path when the existing xo-server process cannot terminate.

      I would appreciate clarification on the intended recovery procedure for this specific scenario.

      posted in Xen Orchestra
      F
      frb94
    • [Bug?] Load Balancer: Performance mode fails to power on hosts previously shut down by Density mode

      [Bug?] Load Balancer: Performance mode fails to power on hosts previously shut down by Density mode

      Hi everyone,

      I'm experiencing a possible bug with the Xen Orchestra Load Balancer plugin when switching from Density to Performance mode.

      Density successfully consolidates VMs and shuts down an unused host, but switching back to Performance does not automatically power that host on, even though Wake-on-LAN is correctly configured and works manually.

      After investigating the source code, I suspect that the host filtering logic prevents Performance mode from detecting hosts that were disabled during shutdown.

      Environment

      • Xen Orchestra: Built from source
      • Build: (November 10, 2026) Xen Orchestra, commit 03e93 | Master, commit 83c3e
      • Plugin: xo-server-load-balancer
      • Storage: Shared storage, live VM migrations working
      • Power-on method: Wake-on-LAN

      The pool contains three hosts:

      Host Role Load Balancer configuration
      XCPNG1 Additional host Excluded from the plan
      XCPNG2 Pool Master Always running
      XCPNG3 Secondary host Managed by Load Balancer

      Xen Orchestra itself runs as a VM on the Pool Master (XCPNG2).

      Steps to reproduce

      1. Start XCPNG2 and XCPNG3.
      2. Set the Load Balancer plan to Performance.
      3. Plugin distributes VMs between both hosts (approximately 50/50).
      4. Switch the plan to Density.
      5. Density successfully migrates the VMs from XCPNG3 to XCPNG2 and automatically shuts down XCPNG3.
      6. Switch the same plan back to Performance.
      7. Save the configuration and wait for multiple Load Balancer execution cycles.

      Expected behavior

      According to the official Xen Orchestra Load Balancing documentation, Performance mode should automatically power on halted hosts when a power-on mode is configured.

      XCPNG3 should therefore power on automatically.

      Actual behavior

      XCPNG3 remains powered off.

      No automatic power-on occurs.

      However, clicking the Play / Power on button for XCPNG3 in the Xen Orchestra UI successfully starts the host.

      The issue does not appear to be related to Wake-on-LAN connectivity.

      Load Balancer configuration

      • Mode: Performance
      • Performance behavior: Conservative
      • CPU critical threshold: 90%
      • RAM free critical threshold: 10000 MB
      • Migration cooldown: 1 minute
      • Maximum concurrent migrations: 1
      • Excluded hosts: XCPNG1

      The same pool and plan work correctly in Density mode.

      Investigation

      1. XAPI power-on mode is configured

      Running the following command on the Pool Master:

      xe host-list params=name-label,uuid,power-on-mode
      

      Returns:

      XCPNG3
      power-on-mode: wake-on-lan
      
      XCPNG1
      power-on-mode: wake-on-lan
      
      XCPNG2
      power-on-mode: wake-on-lan
      

      2. XCPNG3 is disabled after Density shuts it down

      Running:

      xe host-list \
        uuid=dd2cec0b-7849-412e-a040-e2826c35c6cc \
        params=name-label,enabled,power-on-mode
      

      Returns:

      name-label    : XCPNG3
      enabled       : false
      power-on-mode : wake-on-lan
      

      3. Performance mode attempts to power on halted hosts

      In:

      packages/xo-server-load-balancer/src/performance-plan.js

      The execute() method begins with:

      async execute() {
        // Try to power on a hosts set.
        try {
          await Promise.all(
            filter(
              this._getHosts({ powerState: 'Halted' }),
              host => host.powerOnMode !== ''
            ).map(host => {
              const { id } = host
              return this.xo.getXapi(id).powerOnHost(id)
            })
          )
        } catch (error) {
          console.error(error)
        }
      }
      

      This suggests that Performance should attempt to power on halted hosts independently of CPU/RAM thresholds or migration cooldown.

      4. Potential issue in _getHosts()

      In:

      packages/xo-server-load-balancer/src/plan.js

      Lines 256–265:

      _getHosts({ powerState = 'Running' } = {}) {
        return filter(
          this.xo.getObjects(),
          object =>
            object.type === 'host' &&
            includes(this._poolIds, object.$poolId) &&
            object.power_state === powerState &&
            !includes(this._excludedHosts, object.id) &&
            object.enabled === true
        )
      }
      
      object.enabled === true
      

      If a halted host has enabled: false, _getHosts({ powerState: 'Halted' }) appears to exclude it before Performance can call powerOnHost().

      5. Density uses shutdownHost()

      In:

      packages/xo-server-load-balancer/src/density-plan.js

      debug(`Shutdown Host (${fmtSrcHost}).`)
      
      try {
        await xapiSrc.shutdownHost(srcHost.id)
      } catch (error) {
        debug(`Unable to shutdown Host (${fmtSrcHost}).`, { error })
      }
      

      The underlying implementation in:

      packages/xo-server/src/xapi/index.mjs

      Contains:

      async shutdownHost(hostId, { force = false, bypassEvacuate = false } = {}) {
        const host = this.getObject(hostId)
        if (bypassEvacuate) {
          await this.call('host.disable', host.$ref)
        } else {
          await this.clearHost(host, force)
        }
        await this.callAsync('host.shutdown', host.$ref)
      }
      

      This is consistent with the observation that XCPNG3 ends up with enabled: false after being shut down by Density.

      Suspected root cause

      My hypothesis is:

      1. Density evacuates XCPNG3.
      2. Density calls shutdownHost().
      3. XCPNG3 becomes halted and disabled (enabled: false).
      4. Performance calls _getHosts({ powerState: 'Halted' }).
      5. _getHosts() filters out XCPNG3 because enabled !== true.
      6. powerOnHost() is never called for XCPNG3.

      This would explain why manual power-on through the Xen Orchestra UI works while automatic power-on through the Load Balancer does not.

      Possible fix

      Would it make sense to allow disabled hosts to be returned by _getHosts() only when searching for halted hosts to power on?

      For example, the condition:

      object.enabled === true
      

      could potentially become:

      (powerState === 'Halted' || object.enabled === true)
      

      Questions

      1. Is this a known issue in the current Load Balancer implementation?
      2. Is enabled: false expected after Density shuts down a host?
      3. Should Performance be able to restart a host in this state?
      4. Is the enabled === true filter intentional for halted hosts?
      5. Is there an existing workaround or an upstream fix?

      The goal is to use Density at night to consolidate VMs and shut down unused hosts, then switch to Performance during the day to bring those hosts back online automatically.

      Thanks in advance for any insights!

      posted in Xen Orchestra
      F
      frb94
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @poddingue Taking the time to do this it's the bare minium! Here you go: https://github.com/vatesfr/xen-orchestra/issues/10741

      posted in Xen Orchestra
      F
      frb94
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @acebmxer So what are you doing now? Given the manual, NFS is the way, but i can't have the remote available h24 and also i would like to have a functioning XO 😀

      posted in Xen Orchestra
      F
      frb94
    • RE: Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      @poddingue

      Thank you very much for the answer.

      This is my idea for now, but i'll look into better ways to do this.

      */5 * * * * /opt/scripts/enabledisableremote.sh
      
      #!/bin/bash
      
      export PATH="/usr/local/bin:/usr/bin:/bin:$HOME/.npm-global/bin:$PATH"
      
      REMOTE="9fc232df-4d0c-4a15-93b5-c0585c1dd9c9"
      NAS="10.0.0.28"
      
      # Stato attuale del Remote
      CURRENT=$(/usr/local/bin/xo-cli remote.getAll --json | jq -r --arg id "$REMOTE" '.[] | select(.id == $id) | .enabled')
      
      # Stato desiderato in base alla raggiungibilità del NAS
      if ping -c 1 -W 2 "$NAS" > /dev/null 2>&1; then
          DESIRED=true
      else
          DESIRED=false
      fi
      
      # Cambia stato solo se necessario
      if [[ "$CURRENT" == "true" || "$CURRENT" == "false" ]]; then
          if [[ "$CURRENT" != "$DESIRED" ]]; then
              /usr/local/bin/xo-cli remote.set id="$REMOTE" enabled="$DESIRED"
          fi
      fi
      
      posted in Xen Orchestra
      F
      frb94
    • Xen Orchestra web UI becomes unresponsive when an NFS backup remote goes offline

      Hi everyone,

      I am a very new user of XCPNG in my homelab. I think it's a fantastic product and i'm very happy with it. I have an issue that i did not find any reference online. I tried to troubleshoot it with my knowledge, but i did not go far. The following paragraph was written by chatgpt with the finding "we" had. It's all correct as far as i can tell.

      I'm experiencing a reproducible issue with Xen Orchestra when an NFS backup remote becomes unavailable.

      My backup storage is hosted on a Synology NAS configured with Auto Poweroff, which automatically shuts down the NAS after a period of inactivity.

      Xen Orchestra remains powered on 24/7.

      The expectation is that an unavailable backup remote should not affect the availability of the Xen Orchestra management interface, especially when no backup job is running.

      However, after the NAS has been powered off for some time, the entire XO web interface becomes unresponsive.

      After investigating the issue, I found that multiple Node.js libuv worker threads become blocked inside NFS kernel operations.

      Environment

      • Xen Orchestra: Installed from source (ronivay script)
      • XO build: xen-orchestra-202611011738 (November 1, 2026)
      • XO server: Linux, managed by systemd
      • XO server IP: 10.0.0.30
      • Backup storage: Synology NAS
      • NAS IP: 10.0.0.28
      • Remote type: NFS
      • NFS version: 4.0
      • NFS mount options: hard,timeo=600,retrans=2
      • NAS power management: Automatic shutdown after inactivity

      Steps to reproduce

      • Configure an NFS backup remote in Xen Orchestra.
      • Run backup jobs successfully.
      • Wait until all backup operations have finished.
      • Allow the Synology NAS to shut down automatically.
      • Keep Xen Orchestra running.
      • After some time, try opening the XO web interface.

      Same behaviour when trying to enable the already-disabled remote while nas is off.

      Observed result: Chrome keeps loading indefinitely, without displaying the login page.

      The issue occurs even when accessing XO directly by its IP address.

      Investigation

      1. The NFS mount remains active

      Even though the NAS is offline, the NFS remote remains mounted:

      10.0.0.28:/volume2/xobackup
      /run/xo-server/mounts/9fc232df-4d0c-4a15-93b5-c0585c1dd9c9
      nfs4 rw,vers=4.0,hard,proto=tcp,timeo=600,retrans=2

      The Linux kernel repeatedly reports:

      nfs: server 10.0.0.28 not responding, timed out
      nfs: server 10.0.0.28 not responding, still trying

      These messages continue for hours while the NAS is unavailable.

      1. XO remains running

      The service is still reported as active:

      xo-server.service - XO Server
      Active: active (running)
      Main PID: 729 (MainThread)

      The main Node.js thread is not blocked in NFS I/O:

      PID STAT WCHAN
      729 Ssl do_epoll_wait

      1. Multiple libuv workers are blocked

      This is the most interesting finding.

      Running:

      ps -T -p 729 -o pid,tid,stat,wchan:32,comm

      produces:

      PID TID STAT WCHAN COMMAND
      729 729 Ssl do_epoll_wait MainThread
      729 862 Dsl rpc_wait_bit_killable libuv-worker
      729 863 Dsl rpc_wait_bit_killable libuv-worker
      729 864 Dsl rpc_wait_bit_killable libuv-worker
      729 865 Dsl rpc_wait_bit_killable libuv-worker
      729 2840 Ssl futex_wait_queue libuv-worker

      Four libuv workers are blocked in uninterruptible sleep, waiting for NFS RPC operations.

      1. HTTP works without compression

      Interestingly, XO still responds correctly to uncompressed HTTP requests.

      From the XO machine:

      curl -k https://127.0.0.1/signin

      Result:

      HTTP: 200
      Time: 0.005740s

      From another Windows PC:

      curl.exe -k -v https://10.0.0.30/signin -o NUL

      Result:

      HTTP/1.1 200 OK
      Content-Length: 5664
      100 5664

      The entire HTML document is transferred successfully.

      1. HTTP compression hangs

      However, enabling HTTP compression causes the request to hang.

      From Windows:

      curl.exe -k -v --compressed --max-time 10 https://10.0.0.30/signin -o NUL

      Result:

      Accept-Encoding: deflate, gzip
      Request completely sent off

      Operation timed out after 10012 milliseconds
      with 0 bytes received

      The same behavior can be reproduced locally on the XO server using curl --compressed.

      This appears to explain why Chrome cannot display the login page, while basic uncompressed HTTP requests still succeed.

      1. XO logs reference backup remote operations

      The xo-server logs also show stack traces involving:

      BackupNg._listVmBackupsOnRemote
      BackupNg._listVmBackupsWithBackoff

      This suggests XO is attempting to access backup metadata on the unavailable remote.

      Possible root cause

      My hypothesis is that filesystem operations against the unavailable NFS hard mount block libuv worker threads.

      Node.js uses the libuv thread pool for asynchronous filesystem operations and some other operations, including zlib compression.

      If the available workers become blocked waiting for NFS RPC responses, HTTP compression tasks may be unable to complete.

      This would explain the observed behavior:

      • Uncompressed HTTP requests work.
      • Compressed HTTP requests hang.
      • The browser cannot load the GUI.
      • Several libuv workers are stuck in rpc_wait_bit_killable.

      I have confirmed the blocked workers and the compression-dependent HTTP timeout, but I have not yet confirmed the internal scheduling mechanism within Node.js.

      Recovery attempt

      I attempted to terminate the blocked worker threads with kill -9.

      This caused the main Node.js thread to enter a zombie state, while one worker remained blocked:

      PID TID STAT WCHAN
      729 729 Zsl -
      729 864 Dsl rpc_wait_bit_killable

      I also tried a lazy unmount:

      umount -l /run/xo-server/mounts/9fc232df-4d0c-4a15-93b5-c0585c1dd9c9

      The command completed, but the blocked worker remained in the same state.

      These were recovery experiments, not recommended procedures.

      Expected behavior

      Ideally, if an NFS backup remote becomes unavailable:

      • Backup operations involving that remote should report an error or remain isolated.
      • The management GUI should remain responsive.
      • Unrelated operations should continue functioning.
      • An unavailable backup repository should not exhaust the Node.js worker pool.
      • Temporary unavailability of the backup storage should not require force restarting the XO VM.

      Questions

      Is this a known issue with Xen Orchestra's handling of unavailable NFS remotes?

      Is there a recommended configuration for NFS repositories hosted on NAS devices that may power off automatically?

      Does Xen Orchestra periodically access or keep NFS remotes mounted even when no backup jobs are running?

      Would increasing UV_THREADPOOL_SIZE be a reasonable mitigation, or could filesystem operations still exhaust the larger pool?

      Could the remote filesystem operations be isolated from the main xo-server process to prevent this scenario?

      I would prefer to retain NFS hard mounts for backup integrity rather than switching to soft.

      I can provide additional logs and diagnostics if useful.

      Thanks!

      posted in Xen Orchestra
      F
      frb94