-
Notifications
You must be signed in to change notification settings - Fork 22
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
Detach volume groups before deleting machine #460
Conversation
aee8a8c
to
bcc1ed5
Compare
This commit is a workaround to a known problem with hypervisor attached volumes that are created by CSI 3.0. Hypervisor attached volumes result in a volume group disk being attached to the VM on which the pod consuming the PV is running. When a cluster is deleted before deleting the PVC, the prism task fails to delete the VM because an existing volume group is attached to the VM. Since this problem is restricted to CSI 3.0 which relies on a minimum PC version of 2024.1 and the solution requires the volume group detach v4 API which is also available starting 2024.1, we make a v3 get prism central info call to fetch the PC version. If PC version is 2024 or greater we create a v4 client for the cluster as well. Before a machine is deleted, we check if the VM backing the machine has any disks backed by volume groups. If it does, we detach those volume groups before deleting the machine.
bcc1ed5
to
8516a15
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #460 +/- ##
==========================================
- Coverage 31.69% 29.35% -2.35%
==========================================
Files 14 14
Lines 1366 1475 +109
==========================================
Hits 433 433
- Misses 933 1042 +109 ☔ View full report in Codecov by Sentry. |
103cda4
to
4926a09
Compare
as discussed, lets update https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/blob/main/scripts/csi_nutanix_update.sh as well or add a csi 3.0 specific one |
Also, as discussed, lets post the results of using a user with role "Kubernetes Infrastructure Provision" and try create/delete the cluster to verify if any permissions are required if possible |
4926a09
to
ab38e14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/retest |
This commit is a workaround to a known problem with hypervisor attached volumes that are created by CSI 3.0. Hypervisor attached volumes result in a volume group disk being attached to the VM on which the pod consuming the PV is running. When a cluster is deleted before deleting the PVC, the prism task fails to delete the VM because an existing volume group is attached to the VM. Since this problem is restricted to CSI 3.0 which relies on a minimum PC version of 2024.1 and the solution requires the volume group detach v4 API which is also available starting 2024.1, we make a v3 get prism central info call to fetch the PC version. If PC version is 2024 or greater we create a v4 client for the cluster as well. Before a machine is deleted, we check if the VM backing the machine has any disks backed by volume groups. If it does, we detach those volume groups before deleting the machine.
How has this been tested?