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/resource-set): fix error when changing VM resource set #7144

Merged
merged 6 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
- [Self Service] Fix Self users not being able to snapshot VMs when they're members of a user group (PR [#7129](https://github.com/vatesfr/xen-orchestra/pull/7129))
- [Netbox] Fix "The selected cluster is not assigned to this site" error [Forum#7887](https://xcp-ng.org/forum/topic/7887) (PR [#7124](https://github.com/vatesfr/xen-orchestra/pull/7124))
- [Backups] Fix `MESSAGE_METHOD_UNKNOWN` during full backup [Forum#7894](https://xcp-ng.org/forum/topic/7894)(PR [#7139](https://github.com/vatesfr/xen-orchestra/pull/7139))
- [Self Service] Fix error displayed after adding a VM to a resource set ([PR #7144](https://github.com/vatesfr/xen-orchestra/pull/7144))
julien-f marked this conversation as resolved.
Show resolved Hide resolved

### Released packages

Expand Down
4 changes: 4 additions & 0 deletions packages/xo-server/src/xo-mixins/resource-sets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@ export default class {
}

await xapi.xo.setData(vmId, 'resourceSet', resourceSetId === undefined ? null : resourceSetId)
await xapi.barrier(xapi.getObject(vmId).$ref)
// barrier function is used to ensure completion of previous asynchronous operations
// on the vmId object, guaranteeing that all modifications are considered before
// retrieving the resourceSetId value.
$defer.onFailure(() =>
xapi.xo.setData(vmId, 'resourceSet', previousResourceSetId === undefined ? null : previousResourceSetId)
)
Expand Down