mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
F #6333: Fix path for multiple disks (1/2)
This is a partial fix for backup snapshots for VMs with multiple disks. It still fails for disks attached after the VM is created. In this case the SOURCE of the disk is not replace by the "readlink", causing problems to libvirt while resolving disks in the backingStore.
This commit is contained in:
parent
1b3f3d1462
commit
248bc50e16
@ -739,12 +739,11 @@ class KVMDomain
|
||||
|
||||
qdisks << { :did => did, :tgt => tgt, :disk => disk }
|
||||
|
||||
bfile = disk['full-backing-filename']
|
||||
|
||||
next_path = "#{disk.snap}/#{@backup_id.to_i + 1}"
|
||||
next_disk = QemuImg.new(next_path)
|
||||
|
||||
next_disk.create(:f => 'qcow2', :o => 'backing_fmt=qcow2', :b => bfile)
|
||||
next_disk.create(:f => 'qcow2', :o => 'backing_fmt=qcow2',
|
||||
:b => "#{disk.snap}/#{disk.name}")
|
||||
|
||||
dspec << "#{tgt},file=#{next_path}"
|
||||
end
|
||||
@ -777,7 +776,7 @@ class KVMDomain
|
||||
|
||||
cmd("#{virsh} blockcommit", "#{@dom} #{tgt}",
|
||||
:wait => '',
|
||||
:top => disk.path,
|
||||
:top => "#{disk.snap}/#{disk.name}",
|
||||
:base => "#{disk.snap}/0")
|
||||
|
||||
FileUtils.rm(disk.path, :force => true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user