Skip to content

Commit

Permalink
MTV-1576 | VMware apply CBT from extra args
Browse files Browse the repository at this point in the history
Issue:
When customer applies the CBT on running VM by:
`govc vm.change -vm VM_NAME -e "ctkEnabled=TRUE"`
The customer gets a critical conidtion which does not allow them to
migrate the VM.

Fix:
The changes are not propagated to the VM config but to the extra
arguments which we need to query.

Fixes: https://issues.redhat.com/browse/MTV-1576

Signed-off-by: Martin Necas <[email protected]>
  • Loading branch information
mnecas committed Oct 10, 2024
1 parent daf8661 commit 60629f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions pkg/controller/provider/container/vsphere/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package vsphere
import (
"net/url"
"sort"
"strconv"
"strings"

model "github.com/konveyor/forklift-controller/pkg/controller/provider/model/vsphere"
Expand Down Expand Up @@ -610,6 +611,14 @@ func (v *VmAdapter) Apply(u types.ObjectUpdate) {
if s, cast := opt.Value.(string); cast {
v.model.NumaNodeAffinity = strings.Split(s, ",")
}
case "ctkEnabled":
if s, cast := opt.Value.(string); cast {
boolVal, err := strconv.ParseBool(s)
if err != nil {
return
}
v.model.ChangeTrackingEnabled = boolVal
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/lib/condition/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const (
ValidatingVDDK = "ValidatingVDDK"
// Missing IPs on vm pending condition
VMMissingGuestIPs = "VMMissingGuestIPs"
// Missing Changed Block
VMMissingChangedBlockTracking = "VMMissingChangedBlockTracking"
)

// Condition
Expand Down Expand Up @@ -319,7 +321,7 @@ func (r *Conditions) HasBlockerCondition() bool {

// The collection contains blocker conditions that keep the plan reconciling.
func (r *Conditions) HasReQCondition() bool {
return r.HasCondition(ValidatingVDDK) || r.HasCondition(VMMissingGuestIPs)
return r.HasCondition(ValidatingVDDK) || r.HasCondition(VMMissingGuestIPs) || r.HasCondition(VMMissingChangedBlockTracking)
}

// The collection contains the `Ready` condition.
Expand Down

0 comments on commit 60629f5

Please sign in to comment.