Manage an AI Virtual Machine
PaletteAI provides the controls that cover everyday use of an AI Virtual Machine: starting it, stopping it, cloning it, and deleting it. For management beyond those controls, use the VMO console on the Compute Pool's cluster. Refer to Manage the Virtual Machine in VMO.
All of these controls require permission at the scope that owns the virtual machine. A virtual machine shared down from a higher scope can be viewed, used, and cloned, but not started, stopped, or deleted.
Start an AI Virtual Machine
The control is offered when the virtual machine is in the Stopped state.
Starting a stopped virtual machine keeps its disk, so the guest comes back with its filesystem intact.
- UI Workflow
- YAML Workflow
- From the left main menu, open AI Virtual Machines.
- Select the virtual machine, then select Start in the detail header.
- Wait for the Status column to reach Running.
kubectl patch aivirtualmachine <vm-name> --namespace <project-namespace> \
--type merge --patch '{"spec":{"runState":"Running"}}'
Stop an AI Virtual Machine
The control is offered when the virtual machine is in the Running state.
Stopping powers the guest off and keeps its disk. The virtual machine stays on its machine pool, and returns with the same filesystem when you start it again.
- UI Workflow
- YAML Workflow
- From the left main menu, open AI Virtual Machines.
- Select the virtual machine, then select Stop in the detail header.
- Wait for the Status column to reach Stopped.
kubectl patch aivirtualmachine <vm-name> --namespace <project-namespace> \
--type merge --patch '{"spec":{"runState":"Stopped"}}'
Clone an AI Virtual Machine
Cloning copies the virtual machine's configuration into a new virtual machine on the same Compute Pool. It does not copy the contents of the disk, so the clone boots from the template's golden image and runs cloud-init again as a fresh guest.
The new virtual machine is created at the scope you are acting in, and counts there.
- UI Workflow
- YAML Workflow
- From the left main menu, open AI Virtual Machines.
- Select the virtual machine you want to copy.
- Open the Settings menu and select Clone AI Virtual Machine.
- The create workflow opens, filled in from the source. The Compute Pool is fixed to the source's Compute Pool. Set a name for the clone, and adjust anything else you need.
- Select Clone AI Virtual Machine.
Create a new AIVirtualMachine that copies the source's placement and template, and leave spec.virtualMachine unset so the controller renders the new virtual machine from the template:
apiVersion: spectrocloud.com/v1alpha1
kind: AIVirtualMachine
metadata:
name: <clone-name>
namespace: <project-namespace>
spec:
description: <description>
computePoolRef:
name: <compute-pool-name>
namespace: <compute-pool-namespace>
machinePool: <machine-pool>
template:
name: ubuntu-22-04
overrides:
cpuCores: 8
memory: '32 GB'
rootDiskSize: '120 GB'
Copy spec.computePoolRef, spec.machinePool, and spec.template from the source, and set a new metadata.name. Do not copy spec.virtualMachine: it carries the source's disk names, and the controller gives each virtual machine its own disk when it renders. Do not copy status, spec.runState, or spec.sharedWith either.
If you read the source with kubectl get --output yaml to take those fields, use it only as a reference for the values you need, and leave out status and the generated fields under metadata, such as uid, resourceVersion, and creationTimestamp.
Nothing is deployed while spec.virtualMachine is unset. The controller renders a KubeVirt VirtualMachine manifest from the fields above and publishes it in status.renderedVirtualMachine. Read it, write it into spec.virtualMachine on the clone, and apply the updated resource, which deploys the clone:
kubectl get aivirtualmachine <clone-name> --namespace <project-namespace> \
--output jsonpath='{.status.renderedVirtualMachine}' > rendered-virtualmachine.yaml
The clone starts from the template's cloud-init, so any cloud-init you added to the source is not carried over. Add it to the rendered manifest before you write it back.
Delete an AI Virtual Machine
Deleting removes the virtual machine and its disk. The virtual machine reports Terminating until the removal finishes.
This cannot be undone. The disk is destroyed with the virtual machine.
- UI Workflow
- YAML Workflow
- From the left main menu, open AI Virtual Machines.
- Select the virtual machine you want to remove.
- Open the Settings menu and select Delete AI Virtual Machine.
- Enter the virtual machine's name to confirm, then select Delete.
kubectl delete aivirtualmachine <vm-name> --namespace <project-namespace>
Manage the Virtual Machine in VMO
The VMO console on the Compute Pool's cluster is the place for management that PaletteAI does not cover. Use it for advanced lifecycle operations and for configuration changes to a running virtual machine.
Two links take you there:
- On an AI Virtual Machine, the VMO row on the Overview tab opens that virtual machine in the VMO console.
- On the Compute Pool, the VMO row on the overview opens the VMO dashboard for the cluster.
Some controls you might expect are not in PaletteAI. Pausing a running virtual machine and restarting one are not available, so use VMO for those.
Next Steps
- Access an AI Virtual Machine: connect over SSH or VNC.
- Troubleshoot AI Virtual Machines: diagnose placement, template, and provisioning failures.
- AI Virtual Machines: the resource and its states.