Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check VMware Tools version after OVA/OVF deployment without poweron #469

Merged
merged 12 commits into from
Jun 7, 2023

Conversation

ZouYuhua
Copy link
Collaborator

@ZouYuhua ZouYuhua commented Jun 5, 2023

From John:
Can you please check to see if our testing of OVAs includes verification of vmdk that ddb.toolsVersion is set to 2147483647 if open-vm-tools is included? If we are not doing this then please add as a candidate new test. I think the check needs to be done without booting the VM to be valid.

Test result:

  1. test with ubuntu 23.04 OVA:
image
  1. test with photon 5.0 OVA
image

ZouYuhua added 4 commits June 5, 2023 15:35
…s set to 2147483647 if open-vm-tools is included

Signed-off-by: ZouYuhua <[email protected]>
…s set to 2147483647 if open-vm-tools is included

Signed-off-by: ZouYuhua <[email protected]>
…s set to 2147483647 if open-vm-tools is included

Signed-off-by: ZouYuhua <[email protected]>
…s set to 2147483647 if open-vm-tools is included

Signed-off-by: ZouYuhua <[email protected]>
@keirazhang
Copy link
Contributor

keirazhang commented Jun 6, 2023

We already have a common task common/collect_ovf_vm_config.yml, in which ddb.toolsVersion is collected from vm_config.config.tools.toolsVersion.

- name: "Get VMware Tools info"
  ansible.builtin.set_fact:
    ovf_vm_vmtools_info: >-
      {{  
        ovf_vm_vmtools_info |
        combine({'Version': vm_config.config.tools.toolsVersion | default(''),
                 'Install Type': vm_config.config.tools.toolsInstallType | default(''),
                 'Upgrade Policy': vm_config.config.tools.toolsUpgradePolicy | default(''),
                 'Sync Time with Host': vm_config.config.tools.syncTimeWithHost | default('')})
      }}  

I think you can directly use it with some changes:

  1. Move out included task vm_get_vm_info.yml from common/collect_ovf_vm_config.yml, and replace vars like vm_guest_id in common/collect_ovf_vm_config.yml with vm_config.config.guestId.
  2. The moved out vm_get_vm_info.yml can be put after common/collect_ovf_vm_config.yml in linux/deploy_vm/deploy_vm_from_ova.yml and windows/deploy_vm/deploy_vm_from_ova.yml
  3. Move the power on task common/vm_set_power_state.yml from deploy_vm_from_ova.yml into common/collect_ovf_vm_config.yml, and put it before vm_wait_vmtools_status.yml
  4. In common/collect_ovf_vm_config.yml, it collected vmtools version twice: one from vm_config.config.tools.toolsVersion and the other one from guestinfo_vmtools_info. And the second one will overwrite the first one. Since we need to check ddb.toolsVersion before power-on, I suggest you save them with two different keys in ovf_vm_vmtools_info. For example, we can save the first one as 'Config Tools Version' and the second one as 'Guest Tools Version'.
  5. The default ddb.toolsVersion is 2147483647, but OS vendor might change it to real tools version number in meta data. So you need to check it is either 2147483647 or same as guestinfo.vmtools.versionNumber get from vm_extra_config.

common/collect_ovf_vm_config.yml Outdated Show resolved Hide resolved
windows/deploy_vm/deploy_vm_from_ova.yml Outdated Show resolved Hide resolved
Signed-off-by: ZouYuhua <[email protected]>
@keirazhang keirazhang added this to the v3.0 milestone Jun 7, 2023
@keirazhang keirazhang added the enhancement New feature or request label Jun 7, 2023
Copy link
Contributor

@keirazhang keirazhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@ZouYuhua ZouYuhua merged commit 8c3ef55 into vmware:main Jun 7, 2023
@ZouYuhua ZouYuhua deleted the yhzou_2461 branch June 7, 2023 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants