You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried cloning a volume between 2 libvirt storage pools as follows:
volume {
name = "my-new-root-volume"
bus = "virtio"
pool = "default"
alias = "artifact"
source {
type = "cloning"
pool = "my-library-pool"
volume = "noble-server-cloudimg-amd64.img"
}
}
Running that gives with -debug gives the following relevant log entries:
==> test_build.libvirt.cloud_image: Preparing volumes...
test_build.libvirt.cloud_image: Preparing volume
...
==> test_build.libvirt.cloud_image: Pausing after run of step 'stepPrepareVolumes'. Press enter to continue.
==> test_build.libvirt.cloud_image: Sending the domain definition to libvirt
==> test_build.libvirt.cloud_image: Pausing after run of step 'stepDefineDomain'. Press enter to continue.
==> test_build.libvirt.cloud_image: Starting the Libvirt domain
==> test_build.libvirt.cloud_image: DomainCreate.RPC: Storage volume not found: no storage vol with matching name 'my-new-root-volume'
Checking with virsh shows that 'my-new-root-volume' has been created in 'my-library-pool', not in 'default'.
The issue here is in the call to StorageVolCreateXMLFrom in PreparationContext.CloneVolumeFrompreparation_context.go
This is actually passing the sourcePool twice - once as the Pool parameter, and again as sourceVol.Pool. If we alter the call to CloneVolumeFrom to pass in the target pool as the 'Pool' parameter libvirt does the right thing and creates the cloned volume in the specified target pool ('default' in this case).
I have a branch with the updates to get cross-pool clones working, let me know if it would be helpful to tidy it up and open a PR for it.
Thanks!
The text was updated successfully, but these errors were encountered:
I tried cloning a volume between 2 libvirt storage pools as follows:
Running that gives with
-debug
gives the following relevant log entries:Checking with
virsh
shows that 'my-new-root-volume' has been created in 'my-library-pool', not in 'default'.The issue here is in the call to
StorageVolCreateXMLFrom
inPreparationContext.CloneVolumeFrom
preparation_context.goThis is actually passing the sourcePool twice - once as the
Pool
parameter, and again assourceVol.Pool
. If we alter the call to CloneVolumeFrom to pass in the target pool as the 'Pool' parameter libvirt does the right thing and creates the cloned volume in the specified target pool ('default' in this case).I have a branch with the updates to get cross-pool clones working, let me know if it would be helpful to tidy it up and open a PR for it.
Thanks!
The text was updated successfully, but these errors were encountered: