Skip to content

Conversation

@Nambrok
Copy link
Contributor

@Nambrok Nambrok commented Nov 24, 2025

An issue with upgrade from 8.2 to 8.3 can cause an issue with a stunnel pool certificate being empty. It end up creating an error during VDI live migration that can be hard to understand and the solution is to recreate the file using a XAPI command documented in the commit.

Before submitting the pull request, you must agree with the following statements by checking both boxes with a 'x'.

  • "I accept that my contribution is placed under the CC BY-SA 2.0 license [1]."
  • "My contribution complies with the Developer Certificate of Origin [2]."

[1] https://creativecommons.org/licenses/by-sa/2.0/
[2] https://docs.xcp-ng.org/project/contributing/#developer-certificate-of-origin-dco

### Cause

The upgrade from 8.2 to 8.3 can cause an issue where `/etc/stunnel/xapi-pool-ca-bundle.pem` can be empty.
You can check this with `du /etc/stunnel/xapi-pool-ca-bundle.pem` on the host.

Choose a reason for hiding this comment

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

We also see, for example on the Lucas's ticket, that the file is missing. So maybe for clarity add this probability.

Copy link
Member

Choose a reason for hiding this comment

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

And also, what the expected output is when it's empty. Not everyone knows what du does.

Copy link
Member

Choose a reason for hiding this comment

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

Personnally I'd do a simple ls -l and then explain how to recognize the problem from there.


### Cause

Upgrading from 8.2 to 8.3 can cause an issue where `/etc/stunnel/xapi-pool-ca-bundle.pem` can be empty or missing
Copy link
Collaborator

Choose a reason for hiding this comment

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

The second 'can' is redundant:

Suggested change
Upgrading from 8.2 to 8.3 can cause an issue where `/etc/stunnel/xapi-pool-ca-bundle.pem` can be empty or missing
Upgrading from 8.2 to 8.3 can cause an issue where `/etc/stunnel/xapi-pool-ca-bundle.pem` is be empty or missing

Copy link
Member

Choose a reason for hiding this comment

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

Do we know what causes this issue during upgrade?


Upgrading from 8.2 to 8.3 can cause an issue where `/etc/stunnel/xapi-pool-ca-bundle.pem` can be empty or missing
You can check this with `du /etc/stunnel/xapi-pool-ca-bundle.pem` on the host.
It will cause problems with live migrating VDI between SRs (even if the VM remains on the same host) where the migration fails with:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
It will cause problems with live migrating VDI between SRs (even if the VM remains on the same host) where the migration fails with:
It will cause issues when live-migrating VDIs between SRs (even if the VM remains on the same host). The migration fails with:


### Solution

To fix, this, run this command to create the file:
Copy link
Collaborator

@thomas-dkmt thomas-dkmt Nov 24, 2025

Choose a reason for hiding this comment

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

Suggested change
To fix, this, run this command to create the file:
To fix this, create the file with the following command:

xe host-refresh-server-certificate host=<host name>
```
This will create the correct file on the host.
You can run this command to execute it on all the host of the pool:
Copy link
Collaborator

@thomas-dkmt thomas-dkmt Nov 24, 2025

Choose a reason for hiding this comment

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

Suggested change
You can run this command to execute it on all the host of the pool:
To create the file on all the hosts of the pool, run this command:

xe host-list --minimal | tr "," "\n" | xargs -I _ xe host-param-get uuid=_ param-name=name-label | xargs -I _ xe host-refresh-server-certificate host=_
```

To know more about certificates in XAPI, you can read in the [XAPI doc](https://xapi-project.github.io/new-docs/design/pool-certificates/index.html)
Copy link
Collaborator

@thomas-dkmt thomas-dkmt Nov 24, 2025

Choose a reason for hiding this comment

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

Suggested change
To know more about certificates in XAPI, you can read in the [XAPI doc](https://xapi-project.github.io/new-docs/design/pool-certificates/index.html)
To know more about certificates in XAPI, check out the [XAPI documentation](https://xapi-project.github.io/new-docs/design/pool-certificates/index.html).

This will create the correct file on the host.
You can run this command to execute it on all the host of the pool:
```
xe host-list --minimal | tr "," "\n" | xargs -I _ xe host-param-get uuid=_ param-name=name-label | xargs -I _ xe host-refresh-server-certificate host=_
Copy link
Member

Choose a reason for hiding this comment

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

We don't want to make users get into the habit of running commands that they don't understand. Someday, they'll get compromised this way. So let's explain the command to them.

Also, I think it's too complicated. I just tried to run xe host-refresh-server-certificate host=80c8a6d4-d8fd-48d3-a801-f97c650ca302 on my host and it worked. The auto-completion might need fixing in this case (CC @last-genius)

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean the fact that auto-completion suggests the same option twice here?

OPTIONAL: host=  REQUIRED: host=

Copy link
Member

Choose a reason for hiding this comment

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

@last-genius No, I mean the fact that it doesn't offer to autocomplete with the Host UUID, but does accept it as a value. I might be wrong though.

An issue with upgrade from 8.2 to 8.3 can cause an issue with a stunnel pool
certificate being empty. It end up creating an error during VDI live migration
that can be hard to understand and the solution is to recreate the file using a
XAPI command documented in the commit.

Signed-off-by: Damien Thenot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants