Skip to content

Conversation

@RadekManak
Copy link
Contributor

@RadekManak RadekManak commented Oct 20, 2025

This PR replaces PR #156.

More internal context on this change available here: https://redhat-internal.slack.com/archives/GE2HQ9QP4/p1760537328624939


AI Summary

This PR adds support for DataDisks on Azure Stack Hub. It implements extra logic for data disk deletion on Azure Stack Hub when VMs are deleted.

Key Changes:

  • Azure Stack Hub data disk cleanup: On Stack Hub, data disks with DeletionPolicy=Delete are now manually deleted during VM deletion, since the Stack Hub VM API doesn't support the DeleteOption parameter
  • Test infrastructure improvements: Added NewFakeMachineScope helper to enable testing with different Azure cloud environments (Public Cloud vs Stack Hub)
  • DiskEncryptionSet validation: Added validation to prevent configuring DiskEncryptionSet on data disks when running on Azure Stack Hub, as this feature is not supported on Stack Hub
  • Comprehensive test coverage: Added TestStackHubDataDiskDeletion to verify data disk deletion behavior across multiple scenarios (single/multiple disks, Delete/Detach policies, Stack Hub vs Public Cloud)

Behavior:

  • On Azure Public Cloud: No change (existing automatic deletion via VM API still works)
  • On Azure Stack Hub:
    • Will now support Data Disks, whereas it previously didn't
    • Data disks with DeletionPolicy=Delete are now explicitly deleted after VM deletion
    • Data disks with DeletionPolicy=Detach are not deleted (as expected)

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 20, 2025
@openshift-ci-robot
Copy link

@RadekManak: This pull request references Jira Issue OCPBUGS-56664, which is invalid:

  • expected the bug to target either version "4.21." or "openshift-4.21.", but it targets "4.20.0" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This PR updates the generateDataDisks function to not contain DeletionPolicy that is not valid option on used by StackHub.

Because DeletionPolicy spec field is required value I made the machine go Failed when DeletionPolicy is not set to DiskDeletionPolicyTypeDetach. I verified that this is the implicit behavior on stack hub.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from nrb and racheljpg October 20, 2025 16:51
Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

Thanks, a couple of thoughts

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

Nice!
Looks reasonable to me

/approve

@damdo
Copy link
Member

damdo commented Oct 21, 2025

/assign @mdbooth

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 21, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damdo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 21, 2025
Because ASH does not support DeleteOption API field for dataDisks we
need to implement the deletion behavior by deleting the disks that
have DiskDeletionPolicyTypeDelete when machine is deleted.
@RadekManak
Copy link
Contributor Author

/retest

@RadekManak
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 21, 2025
@openshift-ci-robot
Copy link

@RadekManak: This pull request references Jira Issue OCPBUGS-56664, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from sunzhaohua2 October 21, 2025 13:48
@damdo damdo changed the title OCPBUGS-56664: Support datadisks on Stack Hub OCPBUGS-56664: Support atadisks on Stack Hub Oct 21, 2025
@damdo damdo changed the title OCPBUGS-56664: Support atadisks on Stack Hub OCPBUGS-56664: Support DataDisks on Azure Stack Hub Oct 21, 2025
@openshift-ci-robot
Copy link

@RadekManak: This pull request references Jira Issue OCPBUGS-56664, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This PR replaces PR #156.


AI Summary

This PR adds support for DataDisks on Azure Stack Hub. It implements extra logic for data disk deletion on Azure Stack Hub when VMs are deleted.

Key Changes:

  • Azure Stack Hub data disk cleanup: On Stack Hub, data disks with DeletionPolicy=Delete are now manually deleted during VM deletion, since the Stack Hub VM API doesn't support the DeleteOption parameter
  • Test infrastructure improvements: Added NewFakeMachineScope helper to enable testing with different Azure cloud environments (Public Cloud vs Stack Hub)
  • DiskEncryptionSet validation: Added validation to prevent configuring DiskEncryptionSet on data disks when running on Azure Stack Hub, as this feature is not supported on Stack Hub
  • Comprehensive test coverage: Added TestStackHubDataDiskDeletion to verify data disk deletion behavior across multiple scenarios (single/multiple disks, Delete/Detach policies, Stack Hub vs Public Cloud)

Behavior:

  • On Azure Public Cloud: No change (existing automatic deletion via VM API still works)
  • On Azure Stack Hub:
  • Will now support Data Disks, whereas it previously didn't
  • Data disks with DeletionPolicy=Delete are now explicitly deleted after VM deletion
  • Data disks with DeletionPolicy=Detach are not deleted (as expected)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

/lgtm

/hold

For QE testing.

/assign @sunzhaohua2

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 21, 2025
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 21, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 21, 2025

@RadekManak: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn 46b9149 link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@sunzhaohua2
Copy link
Contributor

/verified by @sunzhaohua2
I tried on ASH cluster with DeletionPolicy == Detach and DeletionPolicy == Delete , both cases machines can be created successful.
For DeletionPolicy == Delete ,if delete machine, will delete vm then disk

I1022 11:35:00.297427       1 actuator.go:142] Deleting machine zhsunash22-d4k6j-worker1-kkskx
I1022 11:35:00.300628       1 virtualmachines.go:352] deleting vm zhsunash22-d4k6j-worker1-kkskx
I1022 11:35:00.549425       1 virtualmachines.go:365] successfully deleted vm zhsunash22-d4k6j-worker1-kkskx
I1022 11:35:00.549446       1 disks_stack.go:45] deleting disk zhsunash22-d4k6j-worker1-kkskx_OSDisk
I1022 11:35:00.866371       1 disks_stack.go:61] successfully deleted disk zhsunash22-d4k6j-worker1-kkskx_OSDisk
I1022 11:35:00.866392       1 disks_stack.go:45] deleting disk zhsunash22-d4k6j-worker1-kkskx_data
I1022 11:35:00.944142       1 disks_stack.go:61] successfully deleted disk zhsunash22-d4k6j-worker1-kkskx_data

For DeletionPolicy == Detach , if we delete machine, the data disk will not be deleted

I1022 11:38:08.576448       1 actuator.go:142] Deleting machine zhsunash22-d4k6j-worker2-xbf8z
I1022 11:38:08.579601       1 virtualmachines.go:352] deleting vm zhsunash22-d4k6j-worker2-xbf8z
I1022 11:38:08.913361       1 virtualmachines.go:365] successfully deleted vm zhsunash22-d4k6j-worker2-xbf8z
I1022 11:38:08.913386       1 disks_stack.go:45] deleting disk zhsunash22-d4k6j-worker2-xbf8z_OSDisk
I1022 11:38:09.256457       1 disks_stack.go:61] successfully deleted disk zhsunash22-d4k6j-worker2-xbf8z_OSDisk

And for azure, same behavior

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Oct 22, 2025
@openshift-ci-robot
Copy link

@sunzhaohua2: This PR has been marked as verified by @sunzhaohua2.

In response to this:

/verified by @sunzhaohua2
I tried on ASH cluster with DeletionPolicy == Detach and DeletionPolicy == Delete , both cases machines can be created successful.
For DeletionPolicy == Delete ,if delete machine, will delete vm then disk

I1022 11:35:00.297427       1 actuator.go:142] Deleting machine zhsunash22-d4k6j-worker1-kkskx
I1022 11:35:00.300628       1 virtualmachines.go:352] deleting vm zhsunash22-d4k6j-worker1-kkskx
I1022 11:35:00.549425       1 virtualmachines.go:365] successfully deleted vm zhsunash22-d4k6j-worker1-kkskx
I1022 11:35:00.549446       1 disks_stack.go:45] deleting disk zhsunash22-d4k6j-worker1-kkskx_OSDisk
I1022 11:35:00.866371       1 disks_stack.go:61] successfully deleted disk zhsunash22-d4k6j-worker1-kkskx_OSDisk
I1022 11:35:00.866392       1 disks_stack.go:45] deleting disk zhsunash22-d4k6j-worker1-kkskx_data
I1022 11:35:00.944142       1 disks_stack.go:61] successfully deleted disk zhsunash22-d4k6j-worker1-kkskx_data

For DeletionPolicy == Detach , if we delete machine, the data disk will not be deleted

I1022 11:38:08.576448       1 actuator.go:142] Deleting machine zhsunash22-d4k6j-worker2-xbf8z
I1022 11:38:08.579601       1 virtualmachines.go:352] deleting vm zhsunash22-d4k6j-worker2-xbf8z
I1022 11:38:08.913361       1 virtualmachines.go:365] successfully deleted vm zhsunash22-d4k6j-worker2-xbf8z
I1022 11:38:08.913386       1 disks_stack.go:45] deleting disk zhsunash22-d4k6j-worker2-xbf8z_OSDisk
I1022 11:38:09.256457       1 disks_stack.go:61] successfully deleted disk zhsunash22-d4k6j-worker2-xbf8z_OSDisk

And for azure, same behavior

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@RadekManak
Copy link
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 22, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 5a65161 into openshift:main Oct 22, 2025
8 of 9 checks passed
@openshift-ci-robot
Copy link

@RadekManak: Jira Issue OCPBUGS-56664: Some pull requests linked via external trackers have merged:

The following pull request, linked via external tracker, has not merged:

All associated pull requests must be merged or unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-56664 has not been moved to the MODIFIED state.

This PR is marked as verified. If the remaining PRs listed above are marked as verified before merging, the issue will automatically be moved to VERIFIED after all of the changes from the PRs are available in an accepted nightly payload.

In response to this:

This PR replaces PR #156.

More internal context on this change available here: https://redhat-internal.slack.com/archives/GE2HQ9QP4/p1760537328624939


AI Summary

This PR adds support for DataDisks on Azure Stack Hub. It implements extra logic for data disk deletion on Azure Stack Hub when VMs are deleted.

Key Changes:

  • Azure Stack Hub data disk cleanup: On Stack Hub, data disks with DeletionPolicy=Delete are now manually deleted during VM deletion, since the Stack Hub VM API doesn't support the DeleteOption parameter
  • Test infrastructure improvements: Added NewFakeMachineScope helper to enable testing with different Azure cloud environments (Public Cloud vs Stack Hub)
  • DiskEncryptionSet validation: Added validation to prevent configuring DiskEncryptionSet on data disks when running on Azure Stack Hub, as this feature is not supported on Stack Hub
  • Comprehensive test coverage: Added TestStackHubDataDiskDeletion to verify data disk deletion behavior across multiple scenarios (single/multiple disks, Delete/Detach policies, Stack Hub vs Public Cloud)

Behavior:

  • On Azure Public Cloud: No change (existing automatic deletion via VM API still works)
  • On Azure Stack Hub:
  • Will now support Data Disks, whereas it previously didn't
  • Data disks with DeletionPolicy=Delete are now explicitly deleted after VM deletion
  • Data disks with DeletionPolicy=Detach are not deleted (as expected)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@RadekManak
Copy link
Contributor Author

/cherry-pick release-4.20 release-4.19 release-4.18 release-4.17

@openshift-cherrypick-robot

@RadekManak: new pull request created: #165

In response to this:

/cherry-pick release-4.20 release-4.19 release-4.18 release-4.17

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants