Skip to content

Latest commit

 

History

History
157 lines (108 loc) · 5.32 KB

File metadata and controls

157 lines (108 loc) · 5.32 KB

OpenShift Virtualization Operations Collection

GitHub Release GitHub Actions Workflow Status Semantic Versioning License

Description

This repository contains tooling to support the operational aspects of OpenShift Virtualization.

Documentation

Release Notes

See CHANGELOG.md for release history and changes.

Roles

This collection includes the following roles for operating OpenShift Virtualization:

  • vm_backup_restore - Virtual Machine backup and restore capabilities.
  • vm_collect - Collection of Migration Toolkit for Virtualization inventory information.
  • vm_healthcheck - Health validation and status reporting for Virtual Machines.
  • vm_hot_plug - Hot Plug Virtual Machine resources.
  • vm_lifecycle - Management of the lifecycle activities of Virtual Machines.
  • vm_networking - Manage network attachments on OpenShift Virtualization VMs
  • vm_patching - Patching related activities for Virtual Machines.
  • vm_provision - Provision VirtualMachines on OpenShift Virtualization from specs
  • vm_storage_labeling - Add labels, annotations, and descriptive names to storage volumes (PVCs and DataVolumes).

Requirements

The following Ansible Collections are required:

---
collections:
  - name: redhat.openshift_virtualization
    version: ">=2.1.0"
  - name: redhat.openshift
    version: ">=4.0.0"
  - name: kubernetes.core
    version: ">=5.2.0"
...

Installation

You can install the infra.openshift_virtualization_ops collection with the Ansible Galaxy CLI:

ansible-galaxy collection install infra.openshift_virtualization_ops

Note that if you install any collections from Ansible Galaxy, they will not be upgraded automatically when you upgrade the Ansible package.

To upgrade the collection to the latest available version, run the following command:

ansible-galaxy collection install infra.openshift_virtualization_ops --upgrade

You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format:

---
collections:
  - name: infra.openshift_virtualization_ops
...

See Using Ansible Collections for more details.

Use Cases

This collection is ideal for accomplishing the following using Ansible automation:

  • Day 2 operations of Virtual Machines running in OpenShift.

Testing

tox is used to perform tests and verification of this collection.

The following commands can be used to execute the various types of tests implemented:

tox -av # lists all tests

tox # run them all

tox -e <test name> # run specific one

tox -f sanity --ansible -c tox-ansible.ini     # run tox-ansible that does our ansible-test sanity suite

RVTools Integration

Import VMware VM inventory from RVTools exports and provision or manage VMs on OpenShift Virtualization.

Quick Start

Run the included playbook:

ansible-playbook infra.openshift_virtualization_ops.rvtools_import \
  -e rvtools_src=/data/rvtools_export.xlsx \
  -e rvtools_format=xlsx \
  -e rvtools_target_namespace=vm-prod \
  -e rvtools_storage_class=ocs-storagecluster-ceph-rbd \
  -e '{"rvtools_nad_map": {"VLAN-100-Prod": "prod-net-attach"}}'

Supported RVTools tabs: vInfo, vCPU, vMemory, vDisk, vNetwork, vSnapshot

Formats: xlsx (requires openpyxl), CSV

Components:

  • rvtools_parse module — parses RVTools xlsx and CSV exports
  • rvtools_transform filter plugin — converts parsed data to role request formats
  • rvtools_import.yml playbook — end-to-end RVTools import workflow

Support

The Ansible Forum can be used for additional questions and issues related to this collection.

License

GNU General Public License v3.0 or later.

See the LICENSE to see the full text.