Closed atton closed 3 years ago
Can you provide an example and resolve conflict? I also notices some formatting issues with whitespace.
OK. I will resolve conflict and create examples.
I resolved conflict.
example of clone_volume
through different pool.
I want to clone "template-Debian-8.qcow2" disk into poolB as "foo".
before
f = Fog::Compute.new('...')
v = f.volumes.find{|v| v.name == "template-Debian-8.qcow2"}
v2 = v.dup
v2.name = 'foo'
v2.key = nil
v2.pool_name = 'poolB'
v2.save
after (this PR)
f = Fog::Compute.new('...')
v = f.volumes.find{|v| v.name == "template-Debian-8.qcow2"}
v2 = v.clone_volume(volume_name, 'poolB')
and It's whitespace sensitive
v3 = v.clone_volume('foo','poolB')
v4 = v.clone_volume('foo ','poolB')
# => can create disk with trailing white space
v5 = v.clone_volume('foo ','poolB')
Libvirt::Error: Call to virStorageVolCreateXMLFrom failed: internal error: storage volume name 'foo ' already in use.
This pr has been marked inactive and will be closed if no further activity occurs.
Volume#clone_volume supports duplicate the volume. However, We have two different pools, we can't clone volume directory. So I added an option for specifying the pool name to
Volume#clone_volume
.