Manage VM lifecycle

This guide shows you how to manage the lifecycle of virtual machines using the evroc CLI, including viewing, starting, stopping, updating, and deleting VMs.

List virtual machines

View all VMs in your project:

evroc compute virtualmachine list

Use evroc compute virtualmachine get <name> for detailed information about a specific VM, including its status and IP addresses.

See List Virtual Machines in the API reference.

View VM details

Get detailed information about a specific VM:

evroc compute virtualmachine get myvm

See Get a Virtual Machine in the API reference.

Stop a VM

Stop a running VM. Stopping shuts down the VM, and you can restart it later. Cloud-init doesn't run again on restart.

evroc compute virtualmachine update myvm --running=false

Start a VM

Start a stopped VM:

evroc compute virtualmachine update myvm --running=true

See Update a Virtual Machine in the API reference.

Update a VM

You can update certain VM properties after creation.

Supported updates

The following fields can be updated on a running or stopped VM:

  • Running state - Start or stop the VM
  • Public IP - Attach or detach a Public IP
  • Security groups - Add, remove, or replace security groups
  • Disks - Attach additional data disks (requires stop/start for changes to take effect)
  • Placement group - Change placement group (requires VM to be stopped)

Unsupported updates

The following fields can't be changed after VM creation:

  • Boot disk
  • Resource profile (CPU, memory, GPU)
  • SSH public keys (via CLI/API - however, you can add additional keys manually within the guest OS after logging in)
  • Cloud-init configuration

Attach or detach a Public IP

Attach a Public IP:

evroc compute virtualmachine update myvm --public-ip=mypublicip

Detach a Public IP:

evroc compute virtualmachine update myvm --public-ip=""

Add or remove security groups

Replace all security groups with a new set:

evroc compute virtualmachine update myvm --security-group=web-sg --security-group=app-sg

Add security groups to the existing list:

evroc compute virtualmachine update myvm --append --security-group=new-sg

Remove a security group by omitting it from the replacement list:

evroc compute virtualmachine update myvm --security-group=web-sg  # removes all others

Attach additional disks

You can attach additional data disks to a VM. The disk will become available after the next stop/start cycle.

evroc compute virtualmachine update myvm --append --disk=mydatadisk

Note: After attaching a disk, you must stop and start the VM for the changes to take effect. The disk will need to be formatted and mounted before use.

Change placement group

To change a VM's placement group, you must first stop the VM.

Stop the VM:

evroc compute virtualmachine update myvm --running=false

Change placement group and restart:

evroc compute virtualmachine update myvm --placement-group=my-new-pg --running=true

Delete a VM

Delete a VM permanently. This operation can't be undone.

Warning: Deleting a VM doesn't delete attached disks or Public IPs. These resources must be deleted separately if no longer needed.

evroc compute virtualmachine delete myvm

See Delete a Virtual Machine in the API reference.

Next steps