Can not backup template with SATA

TReinhard

New Member
Apr 26, 2021
3
0
1
45
Hi,

when I try to backup a vm-template with a SATA-Disk it fails:

...
INFO: include disk 'sata0' 'rbd:base-104-disk-0' 8G
INFO: creating Proxmox Backup Server archive 'vm/104/2021-04-26T07:19:00Z'
INFO: starting kvm to execute backup task
kvm: -device ide-hd,bus=ahci0.0,drive=drive-sata0,id=sata0,rotation_rate=1,bootindex=100: Block node is read-only
ERROR: Backup of VM 104 failed - start failed: QEMU exited with code 1
INFO: Failed at 2021-04-26 09:19:02
...

It works when I change the Disk type to SCSI:
...
INFO: include disk 'scsi0' 'rbd:base-104-disk-0' 8G
INFO: creating Proxmox Backup Server archive 'vm/104/2021-04-26T07:22:17Z'
INFO: starting kvm to execute backup task
INFO: started backup task '9dcd08b4-d347-4fd3-beaf-21d73a74f583'
INFO: 8% (684.0 MiB of 8.0 GiB) in 3s, read: 228.0 MiB/s, write: 0 B/s
...

It also works when I use SATA and remove the "tempalte" marking:
...
INFO: VM Name: opnsense
INFO: include disk 'sata0' 'rbd:base-104-disk-0' 8G
INFO: creating Proxmox Backup Server archive 'vm/104/2021-04-26T07:23:43Z'
INFO: starting kvm to execute backup task
INFO: started backup task '54813e9c-5db3-4e5d-9f41-3071b8813003'
INFO: sata0: dirty-bitmap status: created new
INFO: 5% (468.0 MiB of 8.0 GiB) in 3s, read: 156.0 MiB/s, write: 82.7 MiB/s
...

Is this by design or a bug?
 
kvm: -device ide-hd,bus=ahci0.0,drive=drive-sata0,id=sata0,rotation_rate=1,bootindex=100: Block node is read-only
this looks weird? the device is 'ide-hd' but mentions sata0?
can you post the output of 'pveversion -v' and the vm config ? (qm config ID) ?

edit: ignore what i said about ide, this is normal qemu stuff... the configs are interesting nonetheless
 
Last edited:
This is the config:

agent: 1
balloon: 384
bootdisk: sata0
cores: 2
cpu: host
ide2: none,media=cdrom
memory: 1024
name: xxx
net0: virtio=5E:D1:58:32:71:3B,bridge=vmbr0,tag=30
numa: 0
ostype: other
sata0: rbd:base-104-disk-0,discard=on,size=8G,ssd=1
scsihw: virtio-scsi-pci
smbios1: uuid=1ed4ebf0-9bbb-49fb-ab81-ac4dd4b6a2d6
sockets: 1
vmgenid: 997e7d62-546a-4a98-bfe2-b1482a481a34
template: 1
And this this output of 'pveversion -v'

proxmox-ve: 6.3-1 (running kernel: 5.4.106-1-pve)
pve-manager: 6.3-6 (running version: 6.3-6/2184247e)
pve-kernel-5.4: 6.3-8
pve-kernel-helper: 6.3-8
pve-kernel-5.4.106-1-pve: 5.4.106-1
pve-kernel-5.4.65-1-pve: 5.4.65-1
ceph: 14.2.19-pve1
ceph-fuse: 14.2.19-pve1
corosync: 3.1.0-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
libjs-extjs: 6.0.1-10
libknet1: 1.20-pve1
libproxmox-acme-perl: 1.0.8
libproxmox-backup-qemu0: 1.0.3-1
libpve-access-control: 6.1-3
libpve-apiclient-perl: 3.1-3
libpve-common-perl: 6.3-5
libpve-guest-common-perl: 3.1-5
libpve-http-server-perl: 3.1-1
libpve-storage-perl: 6.3-8
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 4.0.6-2
lxcfs: 4.0.6-pve1
novnc-pve: 1.1.0-1
openvswitch-switch: 2.12.3-1
proxmox-backup-client: 1.0.13-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.4-9
pve-cluster: 6.2-1
pve-container: 3.3-4
pve-docs: 6.3-1
pve-edk2-firmware: 2.20200531-1
pve-firewall: 4.1-3
pve-firmware: 3.2-2
pve-ha-manager: 3.1-1
pve-i18n: 2.3-1
pve-qemu-kvm: 5.2.0-5
pve-xtermjs: 4.7.0-3
qemu-server: 6.3-10
smartmontools: 7.2-pve2
spiceterm: 3.1-1
vncterm: 1.6-2
zfsutils-linux: 2.0.4-pve1
 
This error seems to come from QEMU and the SATA driver: Looks like this driver wants write-access to the source-image, but Proxmox define them as read-only when backing up templates.

I'm not going to dig into QEMU-Source so this is my workaround:
--- /usr/share/perl5/PVE/QemuServer.pm~ 2021-03-30 18:40:58.000000000 +0200
+++ /usr/share/perl5/PVE/QemuServer.pm 2021-04-26 12:22:05.521247922 +0200
@@ -3590,7 +3590,7 @@
}

my $drive_cmd = print_drive_commandline_full($storecfg, $vmid, $drive);
- $drive_cmd .= ',readonly' if PVE::QemuConfig->is_template($conf);
+ #$drive_cmd .= ',readonly' if PVE::QemuConfig->is_template($conf);

push @$devices, '-drive',$drive_cmd;
push @$devices, '-device', print_drivedevice_full(
 
other workarounds would be:
- create instance based on template, backup instance
- switch to virtio-scsi
 
This error seems to come from QEMU and the SATA driver: Looks like this driver wants write-access to the source-image, but Proxmox define them as read-only when backing up templates.

I'm not going to dig into QEMU-Source so this is my workaround:
FWIW, I just sent a patch with a similar workaround (limited to skipping the readonly flag for SATA and IDE), which should fix the out-of-the-box experience while we evaluate whether another solution works better in the long-term.

https://lists.proxmox.com/pipermail/pve-devel/2021-April/047935.html
 
  • Like
Reactions: TReinhard

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!