Skip to content

OCPBUGS-61892, OCPBUGS-59743, OCPBUGS-59520, OCPBUGS-63147: Resolve issues with azure data disk - #9947

Open
jcpowermac wants to merge 1 commit into
openshift:mainfrom
jcpowermac:azure-multi-disk-fixes
Open

OCPBUGS-61892, OCPBUGS-59743, OCPBUGS-59520, OCPBUGS-63147: Resolve issues with azure data disk#9947
jcpowermac wants to merge 1 commit into
openshift:mainfrom
jcpowermac:azure-multi-disk-fixes

Conversation

@jcpowermac

@jcpowermac jcpowermac commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Fix copy-paste error where swap disks incorrectly referenced etcd disk
PlatformDiskID in master.go and worker.go.

Fix disk encryption set assignment in machines.go to use
disk.ManagedDisk.DiskEncryptionSet instead of incorrect SecurityProfile path.

Add validation to block data disks on Azure Stack Cloud and enforce
storage account type requirements for managed disks.

Enhance confidential VM validation to check both OS and data disk
security encryption types together for VMGuestStateOnly and
DiskWithVMGuestState scenarios.

Skip default /var partition when user-defined disk already mounts /var.

Co-Authored-By: Cursor noreply@cursor.com
Co-Authored-By: Claude noreply@anthropic.com

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 17, 2025
@openshift-ci

openshift-ci Bot commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@jcpowermac

Copy link
Copy Markdown
Contributor Author

/test ?

@jcpowermac

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-ovn
/test unit
/test golint

@jcpowermac

Copy link
Copy Markdown
Contributor Author

/test unit

/test e2e-azure-ovn-multidisk-techpreview

@jcpowermac

Copy link
Copy Markdown
Contributor Author

/test unit

/test e2e-azure-ovn-multidisk-techpreview

@jcpowermac jcpowermac changed the title azure multi disk fixes OCPBUGS-61892, OCPBUGS-59743, OCPBUGS-59522, OCPBUGS-59521, OCPBUGS-59520: Resolve issues with azure data disk Sep 22, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate 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 Sep 22, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jcpowermac: This pull request references Jira Issue OCPBUGS-61892, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

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.

This pull request references Jira Issue OCPBUGS-59743, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

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.

This pull request references Jira Issue OCPBUGS-59522, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

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.

This pull request references Jira Issue OCPBUGS-59521, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

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.

This pull request references Jira Issue OCPBUGS-59520, which is invalid:

  • expected the bug to target the "4.21.0" version, but no target version was set

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.

Details

In response to this:

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.

@jcpowermac

Copy link
Copy Markdown
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 Sep 22, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jcpowermac: This pull request references Jira Issue OCPBUGS-61892, which is valid. The bug has been moved to the POST state.

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 ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @jinyunma

This pull request references Jira Issue OCPBUGS-59743, which is valid. The bug has been moved to the POST state.

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 ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @jinyunma

This pull request references Jira Issue OCPBUGS-59522, which is valid. The bug has been moved to the POST state.

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 ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @jinyunma

This pull request references Jira Issue OCPBUGS-59521, which is valid. The bug has been moved to the POST state.

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 ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @jinyunma

This pull request references Jira Issue OCPBUGS-59520, which is valid. The bug has been moved to the POST state.

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 ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @jinyunma

Details

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 jinyunma September 22, 2025 13:21
@jcpowermac

jcpowermac commented Sep 22, 2025

Copy link
Copy Markdown
Contributor Author

@jinyunma I think I got all the bugs that were opened for data disks. If you can take a look I would appreciate it, thanks!

one issue that might have to be an rfe is machine-api doesn't support data disks and security profiles

@jcpowermac

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-ovn
/test e2e-azure-ovn-multidisk-techpreview

@jcpowermac

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-ovn
/test e2e-azure-ovn-multidisk-techpreview
/test unit

@jinyunma

Copy link
Copy Markdown
Contributor

@jcpowermac I did pre-merge test with this PR, and checked each bug:

OCPBUGS-61892, installation with swap data disk failed.

Here for worke machines also needs to be updated, else got same panic error.

OCPBUGS-59743, installation on azure stack hub with data disk

looks good, installer has pre-check that data disk does not support on azure stack hub.

OCPBUGS-59522 , Data disk with 'VMGuestStateOnly' security encryption type

Seems good on compute node, installer has pre-check that security profile does not support on compute machine.
But on control plane machine, 'VMGuestStateOnly' security encryption type is still not configured on control plane data disk, same as what describes in bug OCPBUGS-59522

https://issues.redhat.com//browse/OCPBUGS-59520

Issue still can be reproduced with below install-config.yaml file

compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  platform:
    azure:
      dataDisks:
      - cachingType: ReadWrite
        diskSizeGB: 128
        lun: 1
        nameSuffix: vardisk
        managedDisk:
          diskEncryptionSet:
            id: /subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/jima-test-rg/providers/Microsoft.Compute/diskEncryptionSets/jima-des
  diskSetup:
  - type: user-defined
    userDefined:
      platformDiskID: vardisk
      mountPath: /var
  replicas: 3
controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  platform:
    azure:
      dataDisks:
      - cachingType: ReadWrite
        diskSizeGB: 128
        lun: 1
        nameSuffix: vardisk
        managedDisk:
          diskEncryptionSet:
            id: /subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/jima-test-rg/providers/Microsoft.Compute/diskEncryptionSets/jima-des
  diskSetup:
  - type: user-defined
    userDefined:
      platformDiskID: vardisk
      mountPath: /var
  replicas: 3

https://issues.redhat.com//browse/OCPBUGS-59521

issue get fixed, no more panic error.

@jcpowermac
jcpowermac force-pushed the azure-multi-disk-fixes branch from 14b44ab to 859361e Compare October 8, 2025 14:22

// Control plane/master machines use Cluster API which supports data disk security profiles

// https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/cc24323ded8947bef736f90bf73fdb7ff3bb54e4/api/v1beta1/types.go#L693

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jinyunma after looking at the API docs for capz, diskEncryptionSet looks like it needs confidential vm enabled

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For non-confidential vm, diskEncryptionSet can also be applied, see the the structure of ManagedDiskParameters, two DES are defined. One is under ManagedDiskParameters, another is under ManagedDiskParameters.SecurityProfile.
I think they are two different kinds of disk encryption. And ManagedDiskParameters.SecurityProfile requires confidential vm enabled.

Here are Azure docs FYI.
service-side encryption of azure disk
Confidential OS disk encryption

This is also the same as what configures on os disk in installer now

$ ./openshift-install explain installconfig.platform.azure.defaultMachinePlatform.osDisk.diskEncryptionSet
KIND:     InstallConfig
VERSION:  v1

RESOURCE: <object>
  DiskEncryptionSet defines a disk encryption set.

FIELDS:
    name <string> -required-
      Name is the name of the disk encryption set.

    resourceGroup <string> -required-
      ResourceGroup defines the Azure resource group used by the disk
encryption set.

    subscriptionId <string> -required-
      SubscriptionID defines the Azure subscription the disk encryption
set is in.

$ ./openshift-install explain installconfig.platform.azure.defaultMachinePlatform.osDisk.securityProfile.diskEncryptionSet
KIND:     InstallConfig
VERSION:  v1

RESOURCE: <object>
  DiskEncryptionSet specifies the customer managed disk encryption set resource id for the
managed disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and
VMGuestState blob.

FIELDS:
    name <string> -required-
      Name is the name of the disk encryption set.

    resourceGroup <string> -required-
      ResourceGroup defines the Azure resource group used by the disk
encryption set.

    subscriptionId <string> -required-
      SubscriptionID defines the Azure subscription the disk encryption
set is in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jinyunma this is what I used...

controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  diskSetup:
  - type: etcd
    etcd:
      platformDiskID: "etcddisk"
  - type: user-defined
    userDefined:
      platformDiskID: "containers"
      mountPath: /var/lib/containers
  - type: swap
    swap:
      platformDiskID: "swap"
  platform:
    azure:
      type: Standard_D4s_v5
      dataDisks:
      - nameSuffix: etcddisk
        diskSizeGB: 32
        lun: 0
      - nameSuffix: containers
        diskSizeGB: 128
        lun: 1
        managedDisk:
          storageAccountType: StandardSSD_LRS
          diskEncryptionSet:
            id: /subscriptions/19875ffa-41a7-46ea-8714-bddf656ed287/resourceGroups/JCALLEN-RG-DISK-ENCRYPTION-SET/providers/Microsoft.Compute/diskEncryptionSets/jcallen-disk-encryption-set
      - nameSuffix: swap
        diskSizeGB: 128
        lun: 2
  replicas: 3

and https://docs.okd.io/4.18/installing/installing_azure/ipi/installing-azure-preparing-ipi.html#preparing-disk-encryption-sets_installing-azure-preparing-ipi

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Still failing, will have to troubleshoot it more tomorrow. The strange thing is bootstrap is up but MCS never starts running, so the control plane machines of course never come up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah, there is no issue with your configuration. Failed with below configured disk encryption set + mountPath: /var

controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  platform:
    azure:
      dataDisks:
      - cachingType: ReadWrite
        diskSizeGB: 128
        lun: 1
        nameSuffix: vardisk
        managedDisk:
          storageAccountType: Premium_LRS
          diskEncryptionSet:
            id: /subscriptions/53b8f551-f0fc-4bea-8cba-6d1fefd54c8a/resourceGroups/jima-test-rg/providers/Microsoft.Compute/diskEncryptionSets/jima-test-des
  diskSetup:
  - type: user-defined
    userDefined:
      platformDiskID: vardisk
      mountPath: /var
  replicas: 3

./openshift-install craete cluster --dir ipi/
[......]
INFO Waiting up to 20m0s (until 6:50AM UTC) for the Kubernetes API at https://api.jima31diska.qe.azure.devcluster.openshift.com:6443... 
INFO API v1.34.1 up                               
INFO Waiting up to 45m0s (until 7:15AM UTC) for bootstrapping to complete... 
ERROR Bootstrap failed to complete: timed out waiting for the condition 
ERROR Failed to wait for bootstrapping to complete. This error usually happens when there is a problem with control plane hosts that prevents the control plane operators from creating the control plane. 

I could see that master machines were running, but I am unable to ssh connection to them for debug.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am guessing this is the cause.

a10520c

Let me test skipping this if datasetup is defined with /var

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I pushed the changes, still going to test locally

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The change has taken effect, the installation passed on my end too.

@jcpowermac

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-ovn
/test e2e-azure-ovn-multidisk-techpreview
/test unit

@jcpowermac
jcpowermac force-pushed the azure-multi-disk-fixes branch from 859361e to f9cb5ef Compare October 10, 2025 13:30
@jcpowermac
jcpowermac marked this pull request as ready for review October 10, 2025 13:31
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 10, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jcpowermac: This pull request references Jira Issue OCPBUGS-61892, 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 @jinyunma

This pull request references Jira Issue OCPBUGS-59743, 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 @jinyunma

This pull request references Jira Issue OCPBUGS-59522, 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 @jinyunma

This pull request references Jira Issue OCPBUGS-59521, 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 @jinyunma

This pull request references Jira Issue OCPBUGS-59520, 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 @jinyunma

Details

In response to this:

This commit resolves the following issues:

  • machine api does not current support security profiles, disable
  • switch/case for swap used the wrong parameter (etcd vs swap)
  • do not support azure stackcloud with multi disk
  • disk encryption set requires confidentialvm enabled
  • fix validation of confidentialvm with capz

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.

@jcpowermac

Copy link
Copy Markdown
Contributor Author

I will add validation to fail if that is provided on datadisks

@jcpowermac If so, perhaps we don't need to expose the securityEncryptionType parameter to user any more, because it can no longer be set, wdyt? And then the item5 in the PR description might also unnecessary?

one minor issue is that duplicated explanation for dataDisks under controlPlane.platform.azure and compute.platform.azure in doc.

$ ./openshift-install explain installconfig.controlPlane.platform.azure
KIND:     InstallConfig
VERSION:  v1

RESOURCE: <object>
  Azure is the configuration used when installing on Azure.

FIELDS:
...
    dataDisks <[]object>
      DataDisk specifies the parameters that are used to add one or more data disks to the machine.
      DataDisk specifies the parameters that are used to add one or more data disks to the machine.
...

I think I am leaning towards keeping it as-is. We keep our alignment towards capz types (which we will eventually be moving to). There is validation in place so the customer isn't surprised when the policy for the guest isn't applied. It also greatly simplifies the code, we would have to create replacement types, then within the machine creation do conversion to the capz datadisk.

Will fix the documentation.

@jcpowermac
jcpowermac force-pushed the azure-multi-disk-fixes branch from 427240f to 18e0ab3 Compare November 13, 2025 21:24
@jinyunma

Copy link
Copy Markdown
Contributor

Retest these bugs:

OCPBUGS-61892
-> error in bugs doesn't reproduce. But installation with swap disk configured can only configure on worker nodes on 4.21+. Based on documentation, failSwapOn is set to false to allow swap memory use on nodes. However, this parameter is not allowed to be modified on master node and default value is true (4.21 epic: https://issues.redhat.com/browse/OCPNODE-3646). @jcpowermac do we still need to support swap data disk type on control plane from installer side?

OCPBUGS-59743
-> installer exited with message that data disk is not supported on Azure Stack Hub.

$ ./openshift-install create manifests --dir ipi
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: [controlPlane.platform.azure.dataDisks: Invalid value: [{"nameSuffix":"swapdisk","diskSizeGB":64,"lun":0}]: the field dataDisks is not supported on AzureStackCloud., compute[0].platform.azure.dataDisks: Invalid value: [{"nameSuffix":"swapdisk","diskSizeGB":64,"lun":0}]: the field dataDisks is not supported on AzureStackCloud.] 

OCPBUGS-59522
-> installer exited with message that data disk does not support security encryption types.

$ ./openshift-install create manifests --dir ipi/
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: [controlPlane.platform.azure.dataDisks[0].managedDisk.securityProfile.SecurityEncryptionType: Invalid value: "VMGuestStateOnly": security encryption types are not supported on data disks, compute[0].platform.azure.dataDisks[0].managedDisk.securityProfile.SecurityEncryptionType: Invalid value: "VMGuestStateOnly": security encryption types are not supported on data disks, compute[0].platform.azure.dataDisks[0].managedDisk.securityProfile: Invalid value: {"securityEncryptionType":"VMGuestStateOnly"}: data disk security profiles are not supported for worker machines (Machine API limitation). Security profiles for data disks are only supported on control plane machines.]

OCPBUGS-59521
-> Installation with user-defined data disk with disk encryption set is successful (mouted path: /var or /var/lib/containers)

OCPBUGS-63147 OCPBUGS-59520
-> without storageAccountType specified, installer has pre-check and exited with clear message.

$ ./openshift-install create cluster --dir ipi14b/
ERROR failed to fetch Metadata: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: controlPlane.platform.azure.dataDisks[0].managedDisk.storageAccountType: Invalid value: "": storageAccount type must not be empty 

@jcpowermac
jcpowermac force-pushed the azure-multi-disk-fixes branch from 18e0ab3 to ce9b962 Compare November 17, 2025 13:25
@jcpowermac

Copy link
Copy Markdown
Contributor Author

Retest these bugs:

OCPBUGS-61892 -> error in bugs doesn't reproduce. But installation with swap disk configured can only configure on worker nodes on 4.21+. Based on documentation, failSwapOn is set to false to allow swap memory use on nodes. However, this parameter is not allowed to be modified on master node and default value is true (4.21 epic: https://issues.redhat.com/browse/OCPNODE-3646). @jcpowermac do we still need to support swap data disk type on control plane from installer side?

Added validation that control plane nodes are currently unsupported for swap

@jinyunma

Copy link
Copy Markdown
Contributor

All bugs are verified, lgtm on QE side.

/verified by jima

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Nov 18, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jinyunma: This PR has been marked as verified by jima.

Details

In response to this:

All bugs are verified, lgtm on QE side.

/verified by jima

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.

@jcpowermac
jcpowermac force-pushed the azure-multi-disk-fixes branch from ce9b962 to d06a6d0 Compare December 1, 2025 20:05
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Dec 1, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jcpowermac: This pull request references Jira Issue OCPBUGS-61892, 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 @jinyunma

This pull request references Jira Issue OCPBUGS-59743, 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 @jinyunma

This pull request references Jira Issue OCPBUGS-59522, 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 @jinyunma

This pull request references Jira Issue OCPBUGS-59521, 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 @jinyunma

This pull request references Jira Issue OCPBUGS-59520, 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 @jinyunma

This pull request references Jira Issue OCPBUGS-63147, 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 @jinyunma

Details

In response to this:

Fix copy-paste error where swap disks incorrectly referenced etcd disk
PlatformDiskID in master.go and worker.go.

Fix disk encryption set assignment in machines.go to use
disk.ManagedDisk.DiskEncryptionSet instead of incorrect SecurityProfile path.

Add validation to block data disks on Azure Stack Cloud and enforce
storage account type requirements for managed disks.

Enhance confidential VM validation to check both OS and data disk
security encryption types together for VMGuestStateOnly and
DiskWithVMGuestState scenarios.

Skip default /var partition when user-defined disk already mounts /var.

Co-Authored-By: Cursor noreply@cursor.com
Co-Authored-By: Claude noreply@anthropic.com

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.

Comment thread pkg/types/azure/validation/machinepool.go Outdated
@jcpowermac
jcpowermac force-pushed the azure-multi-disk-fixes branch from d06a6d0 to da006fc Compare December 1, 2025 20:39
@jcpowermac

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-ovn

@jcpowermac

Copy link
Copy Markdown
Contributor Author

/assign @tthvo

azure: fix data disk validation and swap disk references

Fix copy-paste error where swap disks incorrectly referenced etcd disk
PlatformDiskID in master.go and worker.go.

Fix disk encryption set assignment in machines.go to use
disk.ManagedDisk.DiskEncryptionSet instead of incorrect SecurityProfile path.

Add validation to block data disks on Azure Stack Cloud and enforce
storage account type requirements for managed disks.

Enhance confidential VM validation to check both OS and data disk
security encryption types together for VMGuestStateOnly and
DiskWithVMGuestState scenarios.

Skip default /var partition when user-defined disk already mounts /var.

Co-Authored-By: Cursor <noreply@cursor.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@jcpowermac
jcpowermac force-pushed the azure-multi-disk-fixes branch from da006fc to 1a9d5a3 Compare December 3, 2025 18:57

@tthvo tthvo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tbh, I have little experience with Azure 😓 I just have a few code-related comments...

Comment on lines +152 to +153
return append(allErrs, field.Invalid(fldPath, azurePool.DataDisks,
fmt.Sprintf("the field dataDisks is not supported on %s.", azure.StackCloud)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return append(allErrs, field.Invalid(fldPath, azurePool.DataDisks,
fmt.Sprintf("the field dataDisks is not supported on %s.", azure.StackCloud)))
return append(allErrs, field.Forbidden(fldPath,
fmt.Sprintf("the field dataDisks is not supported on %s", azure.StackCloud)))

💡 nit: We can shorten the error message by using Forbidden.

<path>.dataDisks: Forbidden: the field dataDisks is not supported on AzureStackCloud

Comment on lines +314 to +321
func dataDiskContainsSecurityEncryptionType(dataDisk capz.DataDisk) bool {
if dataDisk.ManagedDisk != nil && dataDisk.ManagedDisk.SecurityProfile != nil {
if dataDisk.ManagedDisk.SecurityProfile.SecurityEncryptionType != "" {
return true
}
}
return false
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
func dataDiskContainsSecurityEncryptionType(dataDisk capz.DataDisk) bool {
if dataDisk.ManagedDisk != nil && dataDisk.ManagedDisk.SecurityProfile != nil {
if dataDisk.ManagedDisk.SecurityProfile.SecurityEncryptionType != "" {
return true
}
}
return false
}
func dataDiskContainsSecurityEncryptionType(dataDisk capz.DataDisk) bool {
return dataDisk.ManagedDisk != nil &&
dataDisk.ManagedDisk.SecurityProfile != nil &&
dataDisk.ManagedDisk.SecurityProfile.SecurityEncryptionType != ""
}

💡 nit: we can simplify it a bit...

return ""
}

func validateDataDisk(p *azure.MachinePool, poolName string, fldPath *field.Path) field.ErrorList {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💡 I noticed there are duplicate codes for each type of machine pool. Let's refactor a bit, WDYT 👇?

func validateDataDisks(p *azure.MachinePool, poolName string, fldPath *field.Path) field.ErrorList {
	var allErrs field.ErrorList

	// Default machine pool platform has already been validated
	// to not allow specifying dataDisks field.
	if poolName == "" {
		return allErrs
	}

	for i, dataDisk := range p.DataDisks {
		if dataDiskContainsSecurityEncryptionType(dataDisk) {
			allErrs = append(allErrs, field.Invalid(
				fldPath.Index(i).Child("managedDisk").Child("securityProfile").Child("securityEncryptionType"),
				dataDisk.ManagedDisk.SecurityProfile.SecurityEncryptionType,
				"security encryption types are not supported on data disks"))
		}

		switch poolName {
		case types.MachinePoolControlPlaneRoleName:
			// Control plane/master machines use Cluster API which supports data disk security profiles
			// If using a ManagedDisk the StorageAccountType must be defined
			if dataDisk.ManagedDisk != nil && dataDisk.ManagedDisk.StorageAccountType == "" {
				allErrs = append(allErrs, field.Required(
					fldPath.Index(i).Child("managedDisk").Child("storageAccountType"),
					"storageAccount type must not be empty"))
			}
		case types.MachinePoolComputeRoleName:
			// Worker/compute machines use Machine API which does not support data disk security profiles
			if dataDisk.ManagedDisk != nil && dataDisk.ManagedDisk.SecurityProfile != nil {
				allErrs = append(allErrs, field.Forbidden(
					fldPath.Index(i).Child("managedDisk").Child("securityProfile"),
					"data disk security profiles are not supported for worker machines (Machine API limitation). Security profiles for data disks are only supported on control plane machines."))
			}
		}
	}

	return allErrs
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

❓ I have a few questions for this validation:

  • Do we need to consider arbiter and edge nodes? I am not sure if these types are applicable to Azure...?
  • The field dataDisks.managedDisk.storageAccountType is marked as // +optional, but the validation says it should not be empty (thus, required). I am unsure if we can change the kubebuilder marker...

Comment on lines +247 to +248
// Note: All data disks should have the same security encryption type to avoid
// configuration conflicts and ensure consistent security posture.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

❓ This comment says All data disks should have the same security encryption type, but there is no validation for it, right? Should we add it?

Comment on lines +253 to +260
switch dataDisk.ManagedDisk.SecurityProfile.SecurityEncryptionType {
case capz.SecurityEncryptionTypeDiskWithVMGuestState:
return capz.SecurityEncryptionTypeDiskWithVMGuestState
case capz.SecurityEncryptionTypeVMGuestStateOnly:
return capz.SecurityEncryptionTypeVMGuestStateOnly

default:
continue

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

❓ IIUC, we want to make sure to only get the valid security encryption type right (under the assumption that all have the same type)? Should we add a validation for that?

Comment on lines +247 to +249
if encryptionSetID == "" {
return nil, fmt.Errorf("data disk %s has invalid disk encryption set: empty ID", disk.NameSuffix)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💡 Should this check be performed early in machinepool static validation instead?

Comment on lines +50 to +67
if ic.Azure != nil {
varMountPath := false
if ic.ControlPlane != nil {
for _, ds := range ic.ControlPlane.DiskSetup {
if ds.Type == types.UserDefined && ds.UserDefined != nil {
if ds.UserDefined.MountPath == "/var" {
varMountPath = true
}
}
}
}

if !varMountPath {
logrus.Debugf("Adding /var partition to skip CoreOS growfs step")
// See https://issues.redhat.com/browse/OCPBUGS-43625
ignition.AppendVarPartition(a.Config)
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💡 Looks like we can extract the logic into a helper func for easier read...

func (a *Master) Generate(_ context.Context, dependencies asset.Parents) error {
// ...output-omitted...

  if installConfig.Config.Platform.Name() == azure.Name {
     if !hasUserDefinedVarMount(ic.ControlPlane) {
        logrus.Debugf("Adding /var partition to skip CoreOS growfs step")
        // See https://issues.redhat.com/browse/OCPBUGS-43625
        ignition.AppendVarPartition(a.Config)
     }
  }

// ...output-omitted...
}

func hasUserDefinedVarMount(pool *types.MachinePool) bool {
	if pool == nil {
		return false
	}

	for _, ds := range pool.DiskSetup {
		if ds.Type == types.UserDefined &&
			ds.UserDefined != nil &&
			ds.UserDefined.MountPath == "/var" {
			return true
		}
	}
	return false
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, we can skip if ic.Azure != nil as the installConfig.Config.Platform.Name() == azure.Name already does that.

@openshift-ci

openshift-ci Bot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

@jcpowermac: The following tests 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 18e0ab3 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-azure-ovn-shared-vpc 1a9d5a3 link false /test e2e-azure-ovn-shared-vpc
ci/prow/e2e-azurestack 1a9d5a3 link false /test e2e-azurestack
ci/prow/okd-scos-e2e-vsphere-ovn 1a9d5a3 link false /test okd-scos-e2e-vsphere-ovn
ci/prow/artifacts-images 1a9d5a3 link true /test artifacts-images

Full PR test history. Your PR dashboard.

Details

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.

@mtulio

mtulio commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

re-run tests to see the current state of PR as past runs have been expired:

/test e2e-azure-ovn

@mtulio

mtulio commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

fyi we are splitting the bug fixes from this PR to smaller one so we can validate it individually as GA readiness. Those will be shown as reference/links to this PR. Eventually we'll re-title removing the ones that were already splitted:

OCPBUGS-59521: azure: fixes when setting DiskEncryptionSet on data disks
OCPBUGS-59522: azure: reject securityEncryptionType on data disks

/retitle OCPBUGS-61892, OCPBUGS-59743, OCPBUGS-59520, OCPBUGS-63147: Resolve issues with azure data disk
/hold
/cc @mfbonfigli

@openshift-ci
openshift-ci Bot requested a review from mfbonfigli August 21, 2026 22:32
@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 Aug 21, 2026
@openshift-ci openshift-ci Bot changed the title OCPBUGS-61892, OCPBUGS-59743, OCPBUGS-59522, OCPBUGS-59521, OCPBUGS-59520, OCPBUGS-63147: Resolve issues with azure data disk OCPBUGS-61892, OCPBUGS-59743, OCPBUGS-59520, OCPBUGS-63147: Resolve issues with azure data disk Aug 21, 2026
@openshift-ci-robot openshift-ci-robot added jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. and removed jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Aug 21, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jcpowermac: This pull request references Jira Issue OCPBUGS-61892, which is invalid:

  • expected the bug to target either version "5.1.0." or "openshift-5.1.0.", but it targets "4.21" 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.

This pull request references Jira Issue OCPBUGS-59743, which is invalid:

  • expected the bug to target either version "5.1.0." or "openshift-5.1.0.", but it targets "4.21" 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.

This pull request references Jira Issue OCPBUGS-59520, which is invalid:

  • expected the bug to target either version "5.1.0." or "openshift-5.1.0.", but it targets "4.21" 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.

This pull request references Jira Issue OCPBUGS-63147, which is invalid:

  • expected the bug to target either version "5.1.0." or "openshift-5.1.0.", but it targets "4.21" 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.

Details

In response to this:

Fix copy-paste error where swap disks incorrectly referenced etcd disk
PlatformDiskID in master.go and worker.go.

Fix disk encryption set assignment in machines.go to use
disk.ManagedDisk.DiskEncryptionSet instead of incorrect SecurityProfile path.

Add validation to block data disks on Azure Stack Cloud and enforce
storage account type requirements for managed disks.

Enhance confidential VM validation to check both OS and data disk
security encryption types together for VMGuestStateOnly and
DiskWithVMGuestState scenarios.

Skip default /var partition when user-defined disk already mounts /var.

Co-Authored-By: Cursor noreply@cursor.com
Co-Authored-By: Claude noreply@anthropic.com

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.

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

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants