ansible-collections / community.vmware

Ansible Collection for VMware
GNU General Public License v3.0
348 stars 338 forks source link

VCSA Deployment Fails on First Boot #1670

Open PrymalInstynct opened 1 year ago

PrymalInstynct commented 1 year ago
SUMMARY

When attempting to deploy the VCSA OVA (Version 7.0U3k) with ansible the tasks are successful but the resulting Virtual Machine fails upon First Boot.

I am opening this issue against the ansible community,vmware collection because this behavior does not occur when using the VCSA OVA (Version 7.0U3d).

It also does not occur when installing the VCSA OVA (Version 7.0U3k) with the vcsa-cli-installer application built into the VCSA ISO

ISSUE TYPE
COMPONENT NAME

community.vmware.vmware_deploy_ovf

ANSIBLE VERSION
ansible [core 2.14.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/zimmermanc/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /home/zimmermanc/.ansible/collections:/usr/share/ansible/collections
  executable location = /sbin/ansible
  python version = 3.10.9 (main, Dec 19 2022, 17:35:49) [GCC 12.2.0] (/usr/bin/python)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection       Version
---------------- -------
community.vmware 3.4.0 
CONFIGURATION
CONFIG_FILE() = /etc/ansible/ansible.cfg
OS / ENVIRONMENT

I have attempted to run the same playbook from Red Hat 8.7, Fedora 36, Fedora 37, and Arch Linux

STEPS TO REPRODUCE

playbook.yml

---
- hosts: localhost
  name: Deploy the VCSA to an ESXi Host
  gather_facts: false
  vars_files: vcsa_vars.yml

  tasks:
    - community.vmware.vmware_deploy_ovf:
        hostname: "{{ esxi_address }}"
        username: "{{ esxi_username }}"
        password: "{{ esxi_password }}"
        name: "{{ vcenter_hostname }}" # shortname, not FQDN
        ovf: "{{ vcsa_ova_file }}"
        wait_for_ip_address: true
        validate_certs: no
        inject_ovf_env: true
        datastore: "{{ esxi_datastore }}"
        networks: "{u'Network 1':u'{{ esxi_network }}'}"
        properties:
          DeploymentOption.value: "{{ vcsa_size }}" # vCenter t-shirt size: tiny,small,medium,large, or infrastructure
          guestinfo.cis.appliance.net.addr.family: "ipv4" # ipv4 or ipv6
          guestinfo.cis.appliance.net.mode: "static" # static or dhcp
          guestinfo.cis.appliance.net.addr: "{{ vcenter_address }}"
          guestinfo.cis.appliance.net.pnid: "{{ vcenter_hostname }}.{{ domain }}" # FQDN of vcenter server
          guestinfo.cis.appliance.net.prefix: "{{ net_prefix }}" # netmask length, CIDR notation, i.e. '24'
          guestinfo.cis.appliance.net.gateway: "{{ net_gateway }}"
          guestinfo.cis.appliance.net.dns.servers: "{{ dns_servers }}" # Comma separated list of IP addresses of DNS servers.
          guestinfo.cis.appliance.root.passwd: "{{ vcenter_password }}"
          guestinfo.cis.ceip_enabled: "False"
          guestinfo.cis.deployment.autoconfig: "True" # Auto-configure after deployment
          guestinfo.cis.vmdir.domain-name: "{{ domain }}"
          guestinfo.cis.vmdir.username: "{{ vcenter_username }}"
          guestinfo.cis.vmdir.password: "{{ vcenter_password }}" # SSO Password for administrator@vsphere.local
          guestinfo.cis.appliance.ntp.servers: "us.pool.ntp.org"
          guestinfo.cis.appliance.ssh.enabled: "True"
          domain: "{{ domain }}"
          searchpath: "{{ searchpath }}"
      delegate_to: localhost

vcsa_vars.yml

---
esxi_address: "10.10.10.113"
esxi_username: "root"
esxi_password: "*******"
esxi_network: "VM Network"
esxi_datastore: "datastore1"
vcenter_username: "administrator"
vcenter_password: "*******"
vcenter_hostname: "vcsa01"
vcenter_address: "10.10.10.117"
net_prefix: "24"
net_gateway: "10.10.10.1"
dns_servers: "10.10.1.30"
domain: "prymal.linux"
searchpath: ""
vcsa_size: "tiny"
vcsa_ova_file: "/Projects/vcenter/VMware-vCenter-Server-Appliance-7.0.3.01300-21290409_OVF10.ova"
EXPECTED RESULTS

I expect the OVA to be deployed, configured, and be ready for use

ACTUAL RESULTS

The Ansible Tasks complete however the VCSA VM produces an error upon the completion of the First Boot setup tasks

vcsa_firstboot_error

fbInstall.json From /var/log/firstboot/ on the VCSA Host

{
    "progress": 89,
    "progress_message": {
        "id": "install.ciscommon.component.starting",
        "translatable": "Starting %(0)s...",
        "args": [
            "Workload Control Plane"
        ],
        "localized": "Starting Workload Control Plane..."
    },
    "status": "error",
    "info": [],
    "warning": [],
    "question": null,
    "error": {
        "detail": [
            {
                "id": "install.ciscommon.internal.error",
                "translatable": "Encountered an internal error.\n\n%(0)s",
                "args": [
                    "Install-parameter upgrade.import.directory not set"
                ],
                "localized": "Encountered an internal error.\n\nInstall-parameter upgrade.import.directory not set"
            },
            {
                "id": "install.wcp.configure",
                "translatable": "Failed to configure Workload Control Plane",
                "localized": "Failed to configure Workload Control Plane"
            }
        ],
        "componentKey": "wcp",
        "problemId": null,
        "resolution": {
            "id": "install.default.failure.resolution",
            "translatable": "This is an unrecoverable error, please retry install. If you encounter this error again, please search for these symptoms in the VMware Knowledge Base for any known issues and possible resolutions. If none can be found, collect a support bundle and open a support request.",
            "localized": "This is an unrecoverable error, please retry install. If you encounter this error again, please search for these symptoms in the VMware Knowledge Base for any known issues and possible resolutions. If none can be found, collect a support bundle and open a support request."
        }
    },
    "start_time": "2023-03-11T13:19:29.338Z",
    "end_time": "2023-03-11T13:27:08.251Z"
}
williamsitte commented 1 year ago

were you able to resolve this issue? I encountered this exact issue and was curious if you found a resolution. If not, my next step would be to rewrite the playbook to use the CLI instead of the OVF.

jaredhendrickson13 commented 1 year ago

I was having the same issue when deploying VCSA 8 to ESXi and was able to get it working by adding these two lines to the properties parameter in the vmware_deploy_ovf task:

guestinfo.cis.upgrade.import.directory.userConfigurable: 'True'
guestinfo.cis.upgrade.import.directory: '/storage/seat/cis-export-folder'

I found the solution from this article. Says for workstation and fusion, but it fixed the issue for me on ESXi too.