// Module included in the following assemblies:
//
// * virt/virtual_machines/advanced_vm_management

:_newdoc-version: 2.18.3
:_template-generated: 2025-01-24
:_mod-docs-content-type: PROCEDURE

[id="virt-managing-virtual-machines-by-using-openshift-gitops_{context}"]
= Managing virtual machines by using OpenShift GitOps

[role="_abstract"]
To automate and optimize virtual machine (VM) management in {VirtProductName}, you can use Red{nbsp}Hat OpenShift GitOps.

With GitOps, you can set up VM deployments based on configuration files stored in a Git repository. This also makes it easier to automate, update, or replicate these configurations, as well to use version control for tracking their changes.

.Prerequisites

* You have a GitHub account. For instructions to set up an account, see link:https://docs.github.com/en/get-started/start-your-journey/creating-an-account-on-github[Creating an account on GitHub].

* OpenShift Virtualuzation has been installed on your OpenShift cluster. For instructions, see xref:../../../virt/install/installing-virt.adoc#installing-virt[OpenShift Virtualization installation].

* The OpenShift GitOps operator has been installed on your OpenShift cluster. For instructions, see link:https://docs.openshift.com/gitops/1.15/installing_gitops/preparing-gitops-install.html[Installing GitOps].

.Procedure

Follow link:https://developers.redhat.com/learning/learn:manage-openshift-virtual-machines-gitops/resource/resources:connect-and-configure-external-repository-argo-cd-virtual-machines[the _Manage OpenShift virtual machines with GitOps_ learning path] in performing these steps:

. Connect an external Git repository to your Argo CD instance.

. Create the required VM configuration in the Git repository.

. Use the VM configuration to create VMs on your cluster.


[role="_additional-resources"]
.Additional resources
* link:https://docs.openshift.com/gitops/[OpenShift GitOps documentation]

