Hi all,
tl;dr:
- what’s the expected workflow to remove/replace an instance/VM root device?
- why
incus config device override $instance root && incus device remove $instance rootdoesn’t lead to a removed root disk?
Context:
I’m on IncusOS. I’ve created a VM from an Incus-provided template (/rockylinux/10/default) whose full config is:
% incus config show INSTANCE --expanded
architecture: x86_64
config:
boot.autostart: "false"
image.architecture: amd64
image.description: Rockylinux 10 amd64 (20260404_02:06)
image.os: Rockylinux
image.release: "10"
image.requirements.cdrom_agent: "true"
image.serial: "20260404_02:06"
image.type: disk-kvm.img
image.variant: default
limits.cpu: "2"
limits.memory: 2GiB
security.secureboot: "false"
volatile.base_image: 8bd4c4658d804dd7bef50ae845a406fddc5246ab5d929b5018bd258148371aaa
volatile.cloud-init.instance-id: 2ae74b12-6589-438d-9dc1-ac03f7c422fb
volatile.eth0.hwaddr: 10:66:6a:1b:f3:40
volatile.eth1.hwaddr: 10:66:6a:fa:f1:d2
volatile.last_state.power: STOPPED
volatile.uuid: 69925ca6-f0b5-4d85-8545-f31ce8c8bb31
volatile.uuid.generation: 69925ca6-f0b5-4d85-8545-f31ce8c8bb31
volatile.vm.definition: pc-q35-10.2
volatile.vm.needs_reset: "true"
volatile.vm.rtc_adjustment: "-1"
volatile.vm.rtc_offset: "-1"
volatile.vsock_id: "409498921"
devices:
agent:
source: agent:config
type: disk
eth0:
name: eth0
network: incusbr0
type: nic
eth1:
network: incusbr202
type: nic
root:
path: /
pool: local
size: 15GiB
type: disk
ephemeral: false
profiles:
- default
- vm-agent
- vm-default-no-sb
stateful: false
description: ""
I’d like to swap this VM’s root device with another disk image (upstream’s official cloud image) without destroying/recreating the instance.
(I know it would be trivial to do it this way, but I often have the need to swap VMs’ root disk for work. I do it with Proxmox all the time.)
I didn’t find a way to do it in the webUI, so I went to the CLI but incus config device remove INSTANCE root gave:
Device from profile(s) cannot be removed from individual instance. Override device “root” or modify profile instead
Researching this error message mostly gave results for resizing the root device, not removing/replacing it (e.g. Replace or decrease vm's root device, which despite its title it is about shrinking not deleting/replacing).
I’ve looked in the docs and the forums but haven’t found something relevant.
I tried:
% incus config device override INSTANCE root
Device root overridden for INSTANCE
% incus config device remove INSTANCE root
Device root removed from INSTANCE
But that didn’t actually remove the root device:
% incus config show INSTANCE --expanded
...
devices:
agent:
source: agent:config
type: disk
eth0:
name: eth0
network: incusbr0
type: nic
eth1:
network: incusbr202
type: nic
root:
path: /
pool: local
size: 15GiB
type: disk
...
Does it mean an instance cannot be without a root device? A search for “incus diskless instance” doesn’t return anything useful for me. Could it be a leftover of Always set a root disk entry · lxc/incus@0ee94b5 · GitHub? That’s from 2016 though…
I’m not sure I understand the logic behind having instances’ devices “locked” to the profile they were created with. Is it so that all related instances can be updated by updating their attached profiles?
Thanks for any help and/or clarifications!