{"id":15685109,"url":"https://github.com/goneri/deploy-vmware-ci","last_synced_at":"2025-05-08T03:17:30.703Z","repository":{"id":37453081,"uuid":"219857341","full_name":"goneri/deploy-vmware-ci","owner":"goneri","description":"Deploy a VMware lab, ready to be used by the Ansible CI","archived":false,"fork":false,"pushed_at":"2024-01-04T16:04:50.000Z","size":111,"stargazers_count":8,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T03:17:24.270Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goneri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-11-05T21:51:38.000Z","updated_at":"2024-11-26T02:47:22.000Z","dependencies_parsed_at":"2024-01-04T17:27:07.395Z","dependency_job_id":"d60a8032-b4a0-4f0f-a967-d584fc58be9d","html_url":"https://github.com/goneri/deploy-vmware-ci","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goneri%2Fdeploy-vmware-ci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goneri%2Fdeploy-vmware-ci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goneri%2Fdeploy-vmware-ci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goneri%2Fdeploy-vmware-ci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goneri","download_url":"https://codeload.github.com/goneri/deploy-vmware-ci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252990025,"owners_count":21836669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T17:23:40.433Z","updated_at":"2025-05-08T03:17:30.674Z","avatar_url":"https://github.com/goneri.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy ESXi+vsphere lab on libvirt\n\n## Description\n\nThis playbook will deploy:\n\n- a local vsphere\n- two ESXi\n- a datastore VM (with a NFS)\n\nIt can easier target a local Libvirt hypervisor, or an OpenStack tenant.\n\n## Requirements\n\n- a Python virtualenv\n- memory 20GB\n- vcpus: 2 for vcenter, 1 for ESXi, more will probably seriously increase the performance\n- Ansible 2.8+\n- Qcow2 Images. If you can get access to some existing images, it's better. The creation process is time consuming.\n    - ESXi: https://github.com/virt-lightning/esxi-cloud-images\n    - vcenter: https://github.com/goneri/vcsa_to_qcow2\n- A copy of the following repository in the ../ansible-zuul directory.\n    ```shell\n    mkdir ../ansible-zuul\n    git clone https://github.com/ansible/ansible-zuul-jobs ../ansible-zuul/ansible-zuul-jobs\n    git clone https://opendev.org/zuul/zuul-jobs.git ../ansible-zuul/zuul-jobs\n    ```\n\n### Libvirt\n\n- A working libvirt installation\n- Virt-Lightning\n- Ensure nested KVM is enabled\n    ```shell\n    cat /etc/modprobe.d/kvm.conf\n    options kvm_intel nested=1 enable_apicv=n\n    options kvm ignore_msrs=1\n    ```\n\n## Installation\n\n    python3 -menv my_venv\n    source my_venv/bin/activate\n    pip install -r requirements.txt\n\n## Usage\n\nJust use the `--help` argument:\n\n    ./run.py --help\n\nFor instance, to start a deployment:\n    \n    ./run.py deploy\n\n## How to run the community.vmware test-suite\n\n### prepare a venv\n\nPrepare and load a virtualenv, install ansible and position yourself in ~/.ansible/collections/ansible_collections/community/vmware/\n\nYou should also install some extra dependencies with:\n\n    pip install -r requirements.txt -r test-requirements.txt\n\n### Adjust the /etc/hosts\n\nAdd the following entries in your `/etc/hosts`:\n\n    192.168.123.4 datastore.test datastore\n    192.168.123.6 esxi1.test esxi1\n    192.168.123.7 esxi2.test esxi2\n    192.168.123.8 vcenter.test vcenter\n\n### write the configuration for ansible-test\n\nYou need to write a configuration file in your collection directory with the lab credentials. e.g:\n\n    [DEFAULT]\n    vcenter_username: administrator@vsphere.local\n    vcenter_password: QW/B|aEwN*NUQ,~7$Llf\n    vcenter_hostname: vcenter.test\n    vmware_validate_certs: false\n    esxi1_username: zuul\n    esxi1_hostname: esxi1.test\n    esxi1_password: 1oaGnT1OxWOPw3456\n\nTo know the correct passwords, take a look at the following files:\n\n- `/tmp/vcenter/tmp/vcenter_password.txt`\n- `/tmp/vcenter/tmp/esxi_password_zuul.txt`\n\n### call ansible-test\n\nFor here you can call `ansible-test` with:\n\n    VMWARE_TEST_PLATFORM=static ansible-test integration --python 3.9 vmware_dvswitch\n\nJust replace `3.9`` with your actual verison of Python, and `vmware_dvswitch`` with the target to run.\n\n### Automate all these steps with `--run-test true`\n\nYou can automate all these steps if you pass `--run-test true` to `./run.sh`.\nIn this case, the `playbooks/run_test.yaml` playbook will be executed at the end of the deployment.\nYou just need to adjust some variables in `playbooks/run_test.yaml` to match your local set-up.\n\nThe nice part of this is that it reproduces the behaviour of the Zuul-CI. And so, simplify the\ntesting/troubleshooting of Zuul's configuration.\n\n## Configure govc\n\n`govc` (https://github.com/vmware/govmomi/blob/master/govc/USAGE.md) is a light CLI too that you can use to browse your vSphere.\nYou can configure it with the following commands (Bash/zsh):\n\n    export GOVC_PASSWORD=$(crudini --get /tmp/inventory-vmware_rest 'vmware_rest:vars' 'vcenter_password')\n    export GOVC_HOST=vcenter.test\n    export GOVC_USERNAME=administrator@VSPHERE.LOCAL\n    export GOVC_URL=https://vcenter.test/sdk\n    export GOVC_INSECURE=1\n\n\nor with FishShell:\n\n    set -x GOVC_PASSWORD (crudini --get /tmp/inventory-vmware_rest 'vmware_rest:vars' 'vcenter_password')\n    set -x GOVC_HOST vcenter.test\n    set -x GOVC_USERNAME administrator@VSPHERE.LOCAL\n    set -x GOVC_URL https://vcenter.test/sdk\n    set -x GOVC_INSECURE 1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoneri%2Fdeploy-vmware-ci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoneri%2Fdeploy-vmware-ci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoneri%2Fdeploy-vmware-ci/lists"}