Skip to content

Commit

Permalink
Handle v9.0 upgrade finalize case correctly
Browse files Browse the repository at this point in the history
NSX v9.0 upgrade introduces few changes:
* A new upgrade component, 'FINALIZE_UPGRADE'.
* Pre-upgrading the HOST compoenent during the ESXi upgrade.

Upgrading the hosts outside of upgrading coordinator (by upgrading ESXi) affects
the FINALIZE_UPGRADE component - it can be either in 'PAUSE' state, or 'NOT_STARTED'.

Signed-off-by: Kobi Samoray <[email protected]>
  • Loading branch information
ksamoray committed Dec 26, 2024
1 parent 017a648 commit aa25739
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nsxt/resource_nsxt_upgrade_prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,16 @@ func isVCF9HostUpgrade(m interface{}, targetVersion string) (bool, error) {
return false, nil
}
// In this case, all components other than host will be NOT_STARTED, but hosts will be with status SUCCESS
// Finalize component can be NOT_STARTED or PAUSED
for _, c := range statusSummary.ComponentStatus {
if *c.ComponentType == hostUpgradeGroup {
if *c.Status != nsxModel.ComponentUpgradeStatus_STATUS_SUCCESS {
return false, nil
}
} else if *c.ComponentType == finalizeUpgradeGroup {
if *c.Status != nsxModel.ComponentUpgradeStatus_STATUS_PAUSED && *c.Status != nsxModel.ComponentUpgradeStatus_STATUS_NOT_STARTED {
return false, nil
}
} else {
// It's not a host - should be NOT_STARTED
if *c.Status != nsxModel.ComponentUpgradeStatus_STATUS_NOT_STARTED {
Expand Down

0 comments on commit aa25739

Please sign in to comment.