Skip to content

OCPBUGS-77219: vsphere - fix Get-VM null error in multi-vCenter thread jobs#10334

Draft
jcpowermac wants to merge 2 commits intoopenshift:mainfrom
jcpowermac:OCPBUGS-77219
Draft

OCPBUGS-77219: vsphere - fix Get-VM null error in multi-vCenter thread jobs#10334
jcpowermac wants to merge 2 commits intoopenshift:mainfrom
jcpowermac:OCPBUGS-77219

Conversation

@jcpowermac
Copy link
Contributor

In multi-vCenter environments, the thread job in New-OpenshiftVMs passes a string for -Location to Get-Folder and Get-VM. When multiple vCenters are connected, the implicit string-to-Datacenter conversion fails to scope to the correct server, causing "Value cannot be null" errors for VMs on the non-default vCenter.

Explicitly resolve the datacenter string to a Datacenter object via Get-Datacenter before passing it to Get-Folder and Get-VM.

Fixes OCPBUGS-77219

In multi-vCenter environments, the thread job in New-OpenshiftVMs passes
a string for -Location to Get-Folder and Get-VM. When multiple vCenters
are connected, the implicit string-to-Datacenter conversion fails to
scope to the correct server, causing "Value cannot be null" errors for
VMs on the non-default vCenter.

Explicitly resolve the datacenter string to a Datacenter object via
Get-Datacenter before passing it to Get-Folder and Get-VM.

Fixes OCPBUGS-77219

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added 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 Feb 24, 2026
@openshift-ci-robot
Copy link
Contributor

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

  • expected the bug to target the "4.22.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:

In multi-vCenter environments, the thread job in New-OpenshiftVMs passes a string for -Location to Get-Folder and Get-VM. When multiple vCenters are connected, the implicit string-to-Datacenter conversion fails to scope to the correct server, causing "Value cannot be null" errors for VMs on the non-default vCenter.

Explicitly resolve the datacenter string to a Datacenter object via Get-Datacenter before passing it to Get-Folder and Get-VM.

Fixes OCPBUGS-77219

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
Copy link
Contributor

openshift-ci bot commented Feb 24, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jcpowermac for approval. For more information see the Code Review Process.

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

Details 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

@jcpowermac
Copy link
Contributor Author

/hold

needs to be tested, wish I created as draft

@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 Feb 24, 2026
@jcpowermac
Copy link
Contributor Author

/test e2e-vsphere-multi-vcenter-ovn

@jcpowermac jcpowermac marked this pull request as draft February 27, 2026 18:45
@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 Feb 27, 2026
@jcpowermac
Copy link
Contributor Author

/test ?

@jcpowermac
Copy link
Contributor Author

/test e2e-vsphere-ovn-upi
/test e2e-vsphere-ovn-upi-zones

@jcpowermac
Copy link
Contributor Author

/test ?

1 similar comment
@jcpowermac
Copy link
Contributor Author

/test ?

@jcpowermac
Copy link
Contributor Author

/test e2e-vsphere-ovn-upi-multi-vcenter

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 2026

@jcpowermac: all tests passed!

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.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/invalid-bug Indicates that a referenced Jira bug is invalid 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.

2 participants