Bug 1921280

Summary: [VMIO] [vmware] Import a running VM without vmware tools installed causes the import to remain in after validation (0% in the UI)
Product: Container Native Virtualization (CNV) Reporter: Amos Mastbaum <amastbau>
Component: V2VAssignee: Sam Lucidi <slucidi>
Status: CLOSED ERRATA QA Contact: Amos Mastbaum <amastbau>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.6.0CC: cnv-qe-bugs, fdupont
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 14:22:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Amos Mastbaum 2021-01-27 20:24:24 UTC
Description of problem:

Migrating a running vm which has no vmware tools install or that was not booted successfully causes the migration to remain at 0% in the UI
both UI and API indicates the validation was completed successfully, but nothing else happens.


vmimport controller log:

2021-01-27T20:10:17.294998821Z {"level":"error","ts":1611778217.2948232,"logger":"controller","msg":"Reconciler error","controller":"virtualmachineimport-controller","name":"plan-eee-vm-681-4dc8","namespace":"default","error":"ServerFaultCode: Cannot complete operation ******because VMware Tools is not running in this virtual******** machine.","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/remote-source/app/vendor/github.com/go-logr/zapr/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:237\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:209\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\t/remote-source/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:188\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/remote-source/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90"}



Steps to Reproduce:
1. Import a running vm that has no vmware tools install or loaded
2.
3.

Actual results:

vmimport remains at 0% after validation


Expected results:
There should be a clear indication of the Problem both in the UI and in the CR


Additional info:




---------
apiVersion: v2v.kubevirt.io/v1beta1
kind: VirtualMachineImport
metadata:
  annotations:
    vmimport.v2v.kubevirt.io/source-vm-initial-state: up
  selfLink: >-
    /apis/v2v.kubevirt.io/v1beta1/namespaces/default/virtualmachineimports/plan-eee-vm-681-4dc8
  resourceVersion: '7548418'
  name: plan-eee-vm-681-4dc8
  uid: db303a70-51fc-43fa-9a53-d6c777f69a76
  creationTimestamp: '2021-01-27T19:48:16Z'
  generation: 1
  managedFields:
    - apiVersion: v2v.kubevirt.io/v1beta1
      fieldsType: FieldsV1
      fieldsV1:
        'f:metadata':
          'f:labels':
            .: {}
            'f:migration': {}
            'f:plan': {}
            'f:vmID': {}
        'f:spec':
          .: {}
          'f:providerCredentialsSecret':
            .: {}
            'f:name': {}
            'f:namespace': {}
          'f:source':
            .: {}
            'f:vmware':
              .: {}
              'f:mappings':
                .: {}
                'f:networkMappings': {}
                'f:storageMappings': {}
              'f:vm':
                .: {}
                'f:id': {}
          'f:startVm': {}
          'f:targetVmName': {}
      manager: manager
      operation: Update
      time: '2021-01-27T19:48:16Z'
    - apiVersion: v2v.kubevirt.io/v1beta1
      fieldsType: FieldsV1
      fieldsV1:
        'f:metadata':
          'f:annotations':
            .: {}
            'f:vmimport.v2v.kubevirt.io/source-vm-initial-state': {}
          'f:finalizers':
            .: {}
            'v:"vmimport.v2v.kubevirt.io/cancelled-import"': {}
        'f:spec':
          'f:warm': {}
        'f:status':
          .: {}
          'f:conditions': {}
          'f:targetVmName': {}
          'f:warmImport':
            .: {}
            'f:consecutiveFailures': {}
            'f:failures': {}
            'f:successes': {}
      manager: vm-import-controller
      operation: Update
      time: '2021-01-27T19:48:16Z'
  namespace: default
  finalizers:
    - vmimport.v2v.kubevirt.io/cancelled-import
  labels:
    migration: bcb636d2-96f8-437c-a58d-b0b9c49d4dc8
    plan: 6964b632-88f1-46f7-bb1b-779cf324c693
    vmID: vm-681
spec:
  providerCredentialsSecret:
    name: plan-eee-vm-681-4dc8
    namespace: default
  source:
    vmware:
      mappings:
        networkMappings:
          - source:
              id: network-14
            target:
              name: mybridge
              namespace: openshift-cnv
            type: multus
        storageMappings:
          - source:
              id: datastore-12
            target:
              name: nfs
      vm:
        id: 420310f1-0f1d-e4b5-ca57-1794a96a40ac
  startVm: true
  targetVmName: v2v-rhel7-other-os-thin
status:
  conditions:
    - lastHeartbeatTime: '2021-01-27T19:48:16Z'
      lastTransitionTime: '2021-01-27T19:48:16Z'
      message: Validation completed successfully
      reason: ValidationCompleted
      status: 'True'
      type: Valid
    - lastHeartbeatTime: '2021-01-27T19:48:16Z'
      lastTransitionTime: '2021-01-27T19:48:16Z'
      message: All mapping rules checks passed
      reason: MappingRulesVerificationCompleted
      status: 'True'
      type: MappingRulesVerified
  targetVmName: ''
  warmImport:
    consecutiveFailures: 0
    failures: 0
    successes: 0 



Version-Release number of selected component (if applicable):


How reproducible:

Comment 2 Amos Mastbaum 2021-07-05 17:07:51 UTC
verified: cnv48-451

Import error (VMware)
novmtools could not be imported.
ValidationFailed: VM must be powered off, or up to date VMWare Tools must be installed and running to allow the guest to be shutdown gracefully

Comment 5 errata-xmlrpc 2021-07-27 14:22:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Virtualization 4.8.0 Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2920