Virtualization Features in Cozystack
This guide explains how virtualization works within Cozystack.
Virtualization Packages
The Cozystack catalog includes three packages related to virtualization:
virtual-machine
- Virtual Machine (simple)vm-disk
- Virtual Machine diskvm-instance
- Virtual Machine instance
Virtual Machine (simple)
This package provides a quick way to create a simple virtual machine. It allows you to specify the bare minimum parameters to run a VM, but it only supports a single-disk virtual machine.
For production workloads, it is recommended to use vm-disk
and vm-instance
instead.
See the application reference:
virtual-machine
.
Virtual Machine Disk
Before creating a Virtual Machine instance, you need to create a disk from which the VM will boot.
This package defines a virtual machine disk used to store data. You can use a prepared image (also known as golden image), download an image to the disk via HTTP or upload it from a local image. You can also create an empty image.
Golden Image:
## @param source The source image location used to create a disk source: image: name: ubuntu
HTTP:
source: http: url: "https://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img"
Upload:
source: upload: {}
After the disk is created, it will generate a command for uploading using the virtctl tool.
Note:If you want to let virtctl know about right endpoint for uploading images, you need to configure a cluster to specify an endpoint for it:
- Modify your cozystack config map, to enable cdi-uploadproxy along with the dashboard:
kubectl patch cm -n cozy-system cozystack --type merge -p='{"data":{ "expose-services": "dashboard,cdi-uploadproxy" }}'
- Modify your cozystack config to provide a valid CDI uploadproxy endpoint:
values-cdi: | uploadProxyURL: https://cdi-uploadproxy.example.org
- Modify your cozystack config map, to enable cdi-uploadproxy along with the dashboard:
Empty:
source: {}
Optionally, you can specify that the disk is an optical CD-ROM:
optical: true
Created disks can be attached to a Virtual Machine instance.
See the application reference:
vm-disk
.
Virtual Machine Instance
This package defines a Virtual Machine instance, which requires specifying the previously created vm-disk. The first disk is always bootable, and the VM will attempt to boot from it.
disks:
- name: example-system
- name: example-data
The rest parameters are similar to Virtual Machine (simple).
See the application reference:
vm-instance
.
Accessing Virtual Machines
You can access the virtual machine using the virtctl tool:
To access the serial console:
virtctl console <vm>
To access the VM using VNC:
virtctl vnc <vm>
To SSH into the VM:
virtctl ssh <user>@<vm>
Creating and Using Named VM Images
Guide to creating, managing, and using golden (named) VM images in Cozystack to speed up virtual machine deployment.
Running VMs with GPU Passthrough
Running VMs with GPU Passthrough
Running Windows VMs in Cozystack
Running Windows VMs in Cozystack
Virtual Machine Resources
Reference for VM Instance Types and Instance Profiles