Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(xo-server/vm.convertToTemplate): handle VBD_IS_EMPTY #6808

Merged
merged 2 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

> Users must be able to say: “I had this issue, happy to know it's fixed”

- [VM] Fix `VBD_IS_EMPTY` error when converting to template [Forum#61653](https://xcp-ng.org/forum/post/61653) (PR [#6808](https://github.com/vatesfr/xen-orchestra/pull/6808))

### Packages to release

> When modifying a package, add it here with its release type.
Expand All @@ -27,4 +29,6 @@

<!--packages-start-->

- xo-server patch

<!--packages-end-->
3 changes: 2 additions & 1 deletion packages/xo-server/src/api/vm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,8 @@ export async function convertToTemplate({ vm }) {

// Attempts to eject all removable media
const ignoreNotRemovable = error => {
if (error.code !== 'VBD_NOT_REMOVABLE_MEDIA') {
const { code } = error
if (code === 'VBD_IS_EMPTY' && code !== 'VBD_NOT_REMOVABLE_MEDIA') {
julien-f marked this conversation as resolved.
Show resolved Hide resolved
throw error
}
}
Expand Down