live import/restore: query which node to use for operation

In preparation for the switch to -blockdev.

Otherwise, there would be an error:
> An error occurred during live-restore: VM 103 qmp command
> 'block-stream' failed - Permission conflict on node
> 'a25d9b2028b5a364dddbb033603b68c': permissions 'write' are both
> required by node 'drive-ide0' (uses node
> 'a25d9b2028b5a364dddbb033603b68c' as 'file' child) and unshared
> by stream job 'restore-drive-ide0' (uses node
> 'a25d9b2028b5a364dddbb033603b68c' as 'intermediate node' child).

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2025-07-02 18:28:19 +02:00 committed by Fabian Grünbichler
parent 5a7fc4409d
commit 6f167d5cfc

View file

@ -7037,11 +7037,12 @@ sub pbs_live_restore {
# removes itself once all backing images vanish with 'auto-remove=on')
my $jobs = {};
for my $ds (sort keys %$restored_disks) {
my $node_name = PVE::QemuServer::Blockdev::get_node_name_below_throttle($vmid, $ds);
my $job_id = "restore-$ds";
mon_cmd(
$vmid, 'block-stream',
'job-id' => $job_id,
device => "$ds",
device => "$node_name",
'auto-dismiss' => JSON::false,
);
$jobs->{$job_id} = {};
@ -7138,11 +7139,13 @@ sub live_import_from_files {
# removes itself once all backing images vanish with 'auto-remove=on')
my $jobs = {};
for my $ds (sort keys %$live_restore_backing) {
my $node_name =
PVE::QemuServer::Blockdev::get_node_name_below_throttle($vmid, "drive-$ds");
my $job_id = "restore-$ds";
mon_cmd(
$vmid, 'block-stream',
'job-id' => $job_id,
device => "drive-$ds",
device => "$node_name",
'auto-dismiss' => JSON::false,
);
$jobs->{$job_id} = {};