Skip to content

🌱 Improve visibility of pending events during VM creation - #1916

Open
bryanv wants to merge 1 commit into
vmware-tanzu:mainfrom
bryanv:bryanv/vm-controller-emit-pending-events
Open

🌱 Improve visibility of pending events during VM creation#1916
bryanv wants to merge 1 commit into
vmware-tanzu:mainfrom
bryanv:bryanv/vm-controller-emit-pending-events

Conversation

@bryanv

@bryanv bryanv commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

What does this PR do, and why is it needed?

Somewhat confusingly we could emit multiple CreateSuccess events during the VM creation process. Also, if we are waiting for the VMIC to be ready, the VM controller logs would not indicate that, making it unclear why a reconcile was a noop.

Change the suffix for NoRequeueErrors during create to be pending, since that error means we are just waiting for some external resource to be ready.

Which issue(s) is/are addressed by this PR? (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Fixes # vmop-4182

Are there any special notes for your reviewer:

Example:

$ k desc vm ...
  Warning  CreatePending  11s                virtualmachine-controller  error getting device for interface eth0: network interface is not ready
  Warning  CreatePending  11s                virtualmachine-controller  error getting device for interface eth0: network interface is not ready
  Warning  CreatePending  10s (x2 over 11s)  virtualmachine-controller  error getting device for interface eth0: network interface is not ready
  Warning  CreatePending  10s                virtualmachine-controller  disk image cache is not ready
  Normal   CreateSuccess  0s                 virtualmachine-controller  Create success
$ k logs ...
[pod/vmware-system-vmop-controller-manager-6745ffccff-82v8g/manager] I0910 18:42:39.263209       1 virtualmachine_controller.go:638] "Finished Reconciling VirtualMachine" logger="virtualmachine-controller" VirtualMachine="vmsvc-e2e-zvg016/vm22" reconcileID="3b101091-85c3-449b-97f9-d2a09a57b157" noRequeueReason="error getting device for interface eth0: network interface is not ready"
[pod/vmware-system-vmop-controller-manager-6745ffccff-82v8g/manager] I0910 18:42:39.523268       1 virtualmachine_controller.go:638] "Finished Reconciling VirtualMachine" logger="virtualmachine-controller" VirtualMachine="vmsvc-e2e-zvg016/vm22" reconcileID="ce13fe19-5759-4ec9-be42-1f281a1929f7" noRequeueReason="error getting device for interface eth0: network interface is not ready"
[pod/vmware-system-vmop-controller-manager-6745ffccff-82v8g/manager] I0910 18:42:39.568134       1 virtualmachine_controller.go:638] "Finished Reconciling VirtualMachine" logger="virtualmachine-controller" VirtualMachine="vmsvc-e2e-zvg016/vm22" reconcileID="9f4bfbac-4b9b-42fa-8641-74f45ac21ced" noRequeueReason="error getting device for interface eth0: network interface is not ready"
[pod/vmware-system-vmop-controller-manager-6745ffccff-82v8g/manager] I0910 18:42:40.771465       1 virtualmachine_controller.go:638] "Finished Reconciling VirtualMachine" logger="virtualmachine-controller" VirtualMachine="vmsvc-e2e-zvg016/vm22" reconcileID="2533451a-eb66-46af-a8a9-c0e1d38de3af" noRequeueReason="failed to reconcile vSphere policies for placement: failed to evaluate policy: VM vmsvc-e2e-zvg016/vm22 PolicyEvaluation vmsvc-e2e-zvg016/vm-vm22 still being evaluated: policy not ready"
[pod/vmware-system-vmop-controller-manager-6745ffccff-82v8g/manager] I0910 18:42:41.128275       1 virtualmachine_controller.go:638] "Finished Reconciling VirtualMachine" logger="virtualmachine-controller" VirtualMachine="vmsvc-e2e-zvg016/vm22" reconcileID="9817c649-3832-4329-8c4c-b0efd670f2b6" noRequeueReason="disk image cache is not ready"
[pod/vmware-system-vmop-controller-manager-6745ffccff-82v8g/manager] I0910 18:42:41.309880       1 virtualmachine_controller.go:638] "Finished Reconciling VirtualMachine" logger="virtualmachine-controller" VirtualMachine="vmsvc-e2e-zvg016/vm22" reconcileID="568f0b03-830d-4d18-a60f-02088a85a0d0" noRequeueReason="disk image cache is not ready"
[pod/vmware-system-vmop-controller-manager-6745ffccff-82v8g/manager] I0910 18:42:48.717270       1 virtualmachine_controller.go:638] "Finished Reconciling VirtualMachine" logger="virtualmachine-controller" VirtualMachine="vmsvc-e2e-zvg016/vm22" reconcileID="5368da99-249c-4b15-80f3-ee58eb0cddc6" noRequeueReason="disk image cache is not ready"

I agree the message for the network not ready "errors" need to be improved but would prefer to kick those to a later MR.

Please add a release note if necessary:

NONE

@github-actions github-actions Bot added the size/S Denotes a PR that changes 10-29 lines. label Sep 9, 2026
@bryanv
bryanv force-pushed the bryanv/vm-controller-emit-pending-events branch from 14a3a2c to 32f8a40 Compare September 10, 2026 15:44
@github-actions github-actions Bot added size/M Denotes a PR that changes 30-99 lines. and removed size/S Denotes a PR that changes 10-29 lines. labels Sep 10, 2026
@bryanv
bryanv marked this pull request as ready for review September 10, 2026 18:46
@bryanv
bryanv requested review from a team and faisalabujabal as code owners September 10, 2026 18:46
@bryanv
bryanv force-pushed the bryanv/vm-controller-emit-pending-events branch from 32f8a40 to c3a9d46 Compare September 10, 2026 18:48
Somewhat confusingly we could emit multiple CreateSuccess events
during the VM creation process. Also, if we are waiting for the
VMIC to be ready, the VM controller logs would not indicate that,
making it unclear why a reconcile was a noop.

Change the suffix for NoRequeueErrors during create to be pending,
since that error means we are just waiting for some external
resource to be ready.
@bryanv
bryanv force-pushed the bryanv/vm-controller-emit-pending-events branch from c3a9d46 to 5b5eeed Compare September 11, 2026 17:16
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
github.com/vmware-tanzu/vm-operator/controllers/configtarget 74%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/clustercontentlibraryitem 67%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/contentlibraryitem 67%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils 85%
github.com/vmware-tanzu/vm-operator/controllers/infra/capability/configmap 92%
github.com/vmware-tanzu/vm-operator/controllers/infra/capability/crd 100%
github.com/vmware-tanzu/vm-operator/controllers/infra/configmap 75%
github.com/vmware-tanzu/vm-operator/controllers/infra/node 77%
github.com/vmware-tanzu/vm-operator/controllers/infra/secret 76%
github.com/vmware-tanzu/vm-operator/controllers/infra/validatingwebhookconfiguration 87%
github.com/vmware-tanzu/vm-operator/controllers/infra/workloadnetworkconfig 86%
github.com/vmware-tanzu/vm-operator/controllers/infra/zone 76%
github.com/vmware-tanzu/vm-operator/controllers/storage/storageclass 93%
github.com/vmware-tanzu/vm-operator/controllers/storage/storagepolicy 96%
github.com/vmware-tanzu/vm-operator/controllers/storage/storagepolicyquota 91%
github.com/vmware-tanzu/vm-operator/controllers/storage/volumeattributesclass 93%
github.com/vmware-tanzu/vm-operator/controllers/util/encoding 73%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/storagepolicyusage 96%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/virtualmachine 65%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/volume 85%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/volumebatch 89%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass 73%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineconfigoptions 87%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinegroup 90%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinegrouppublishrequest 88%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineimagecache 89%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest 84%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinereplicaset 67%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice 91%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/providers 93%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy 81%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesnapshot 91%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest 72%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1 72%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions 88%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/patch 78%
github.com/vmware-tanzu/vm-operator/controllers/vspherepolicy/policyevaluation 87%
github.com/vmware-tanzu/vm-operator/pkg/bitmask 100%
github.com/vmware-tanzu/vm-operator/pkg/builder 89%
github.com/vmware-tanzu/vm-operator/pkg/conditions 90%
github.com/vmware-tanzu/vm-operator/pkg/config 100%
github.com/vmware-tanzu/vm-operator/pkg/config/capabilities 97%
github.com/vmware-tanzu/vm-operator/pkg/config/env 100%
github.com/vmware-tanzu/vm-operator/pkg/context 37%
github.com/vmware-tanzu/vm-operator/pkg/context/generic 100%
github.com/vmware-tanzu/vm-operator/pkg/context/operation 100%
github.com/vmware-tanzu/vm-operator/pkg/crd 77%
github.com/vmware-tanzu/vm-operator/pkg/errors 74%
github.com/vmware-tanzu/vm-operator/pkg/exit 100%
github.com/vmware-tanzu/vm-operator/pkg/log 100%
github.com/vmware-tanzu/vm-operator/pkg/mem 100%
github.com/vmware-tanzu/vm-operator/pkg/patch 78%
github.com/vmware-tanzu/vm-operator/pkg/prober 89%
github.com/vmware-tanzu/vm-operator/pkg/prober/probe 90%
github.com/vmware-tanzu/vm-operator/pkg/prober/worker 77%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere 74%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/clustermodules 73%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/config 88%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/contentlibrary 76%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/credentials 100%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/network 87%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/placement 70%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/session 60%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/storage 44%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/upgrade/virtualmachine 96%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/upgrade/virtualmachine/backfill 96%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vcenter 86%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/virtualmachine 85%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/virtualmachine/extraconfig 91%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/virtualmachine/networkextraconfig 75%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vmlifecycle 77%
github.com/vmware-tanzu/vm-operator/pkg/record 84%
github.com/vmware-tanzu/vm-operator/pkg/topology 91%
github.com/vmware-tanzu/vm-operator/pkg/util 79%
github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit 89%
github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit/validate 91%
github.com/vmware-tanzu/vm-operator/pkg/util/image 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube 91%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/cource 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/internal 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/networksettings 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/proxyaddr 73%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/spq 99%
github.com/vmware-tanzu/vm-operator/pkg/util/linuxprep 97%
github.com/vmware-tanzu/vm-operator/pkg/util/netplan 100%
github.com/vmware-tanzu/vm-operator/pkg/util/nil 100%
github.com/vmware-tanzu/vm-operator/pkg/util/ovfcache 75%
github.com/vmware-tanzu/vm-operator/pkg/util/ovfcache/internal 100%
github.com/vmware-tanzu/vm-operator/pkg/util/paused 100%
github.com/vmware-tanzu/vm-operator/pkg/util/ptr 100%
github.com/vmware-tanzu/vm-operator/pkg/util/resize 98%
github.com/vmware-tanzu/vm-operator/pkg/util/sysprep 98%
github.com/vmware-tanzu/vm-operator/pkg/util/vmopv1 88%
github.com/vmware-tanzu/vm-operator/pkg/util/volumes 100%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/client 66%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/datastore 100%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/fault 100%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/library 95%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/storage 82%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/task 94%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/vm 79%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/watcher 85%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig 95%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/anno2extraconfig 100%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/bootoptions 88%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/cdrom 88%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/crypto 92%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/diskpromo 100%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/extensioncompatconstraint 93%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/extraconfig 100%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/networkextraconfig 79%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/policy 97%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/virtualcontroller 93%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/volumes/unmanaged/backfill 98%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/volumes/unmanaged/register 92%
github.com/vmware-tanzu/vm-operator/pkg/webconsolevalidation 100%
github.com/vmware-tanzu/vm-operator/services/vm-watcher 85%
github.com/vmware-tanzu/vm-operator/webhooks/common 98%
github.com/vmware-tanzu/vm-operator/webhooks/configtarget/validation 87%
github.com/vmware-tanzu/vm-operator/webhooks/persistentvolumeclaim/validation 95%
github.com/vmware-tanzu/vm-operator/webhooks/unifiedstoragequota/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/mutation 86%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/validation 96%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/mutation 62%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineconfigoptions/validation 88%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinegroup/mutation 87%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinegroup/validation 93%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinegrouppublishrequest/mutation 86%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinegrouppublishrequest/validation 88%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineguestoptions/validation 88%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/validation 90%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinereplicaset/validation 90%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/mutation 67%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesnapshot/mutation 86%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesnapshot/validation 91%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/validation 92%
Summary 84% (21865 / 25877)

Minimum allowed line rate is 79%

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

Labels

size/M Denotes a PR that changes 30-99 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants