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

[SMAPIv3] xe vdi-create leaves VDI half-created on error in Volume.set for vdi-type=user #5530

Open
ydirson opened this issue Mar 25, 2024 · 0 comments

Comments

@ydirson
Copy link
Contributor

ydirson commented Mar 25, 2024

On SMAPIv3 xe vdi-create makes one call to Volume.create then wants set a vdi-type field using Volume.set.
When this second call fails, the VDI creation is failed, but the created volume is left untouched, to be picked up by a later sr-scan and appear as a VDI as if the call had succeeded.

It looks like objects created should be destroyed in case of errors?

ydirson added a commit to xcp-ng/xcp-ng-xapi-storage that referenced this issue Mar 26, 2024
Note that if Volume.set were not implemented yet (or indeed cannot
complete and returns an error), we face xapi-project/xen-api#5530: if
the Volume.set call fails (to add the vdi-type=user custom-key
record), then the VDI object is not created (though, as this happens
after Volume.create, the zvol and DB entries were indeed created and
there suppression was not requested by SMAPI after the error).  But
since all the VDI information that count are here, "xe sr-scan" will
bring those VDI to life (after implementation of SR.ls).

Originally-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
ydirson added a commit to xcp-ng/xcp-ng-xapi-storage that referenced this issue Apr 2, 2024
We create sparse volumes, making the SR a thin-provisioning one.

Cache as vsize the actual size created by the zfs command (which in
zfs-2.1 unlike in zfs-0.8 does round up requested size to be acceptable).

Note that if Volume.set were not implemented yet (or indeed cannot
complete and returns an error), we face xapi-project/xen-api#5530: if
the Volume.set call fails (to add the vdi-type=user custom-key
record), then the VDI object is not created (though, as this happens
after Volume.create, the zvol and DB entries were indeed created and
there suppression was not requested by SMAPI after the error).  But
since all the VDI information that count are here, "xe sr-scan" will
bring those VDI to life (after implementation of SR.ls).

Originally-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
ydirson added a commit to xcp-ng/xcp-ng-xapi-storage that referenced this issue Apr 4, 2024
We create sparse volumes, making the SR a thin-provisioning one.

Cache as vsize the actual size created by the zfs command (which in
zfs-2.1 unlike in zfs-0.8 does round up requested size to be acceptable).

Note that if Volume.set were not implemented yet (or indeed cannot
complete and returns an error), we face xapi-project/xen-api#5530: if
the Volume.set call fails (to add the vdi-type=user custom-key
record), then the VDI object is not created (though, as this happens
after Volume.create, the zvol and DB entries were indeed created and
there suppression was not requested by SMAPI after the error).  But
since all the VDI information that count are here, "xe sr-scan" will
bring those VDI to life (after implementation of SR.ls).

Originally-by: Matias Ezequiel Vara Larsen <matias.vara@vates.fr>
Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
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

No branches or pull requests

1 participant