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
{{ message }}
Repository navigation
Commit ac8d69c
Browse filesBrowse the repository at this point in the historyBrowse files
importVM improvements: RBD support, volume format, and cluster selection (#14162)
* kvm: allow importVm importsource=shared from an RBD pool
The CheckVolumeCommand wrapper on the KVM agent only accepted file based
pools, so importing a root disk straight from Ceph failed on the agent
with "Unsupported Storage Pool" and surfaced as "Disk not found or is
invalid" on the management server. Add RBD to the supported pool types,
take the virtual size from the disk libvirt resolved (qemu-img cannot
open a bare RBD image name), skip the QCOW2 header check for raw RBD
images, and build the rbd: URI when running qemu-img info, the same way
LibvirtGetVolumesOnStorageCommandWrapper already does for
listVolumesForImport.
* kvm: record the real image format on an imported volume
importVolume and updateImportedVolume both stamped the cluster default
format for the hypervisor, so a volume imported from an RBD pool was
recorded as QCOW2 while a natively deployed volume on the same pool is
RAW. This affected both entry points: importVm importsource=shared for a
root disk, and importVolume for a data disk.
Pass the format the hypervisor reported for the existing image, from the
check answer for a root disk and from the volume listed on the pool for
a data disk, and fall back to the hypervisor default only when no format
is reported. This also corrects a raw image imported from a file based
pool.
* vm import: plan the instance inside the pod and cluster of the requested pool
importKVMInstanceFromDiskImage planned with the pod and cluster unset, so
the planner was free to pick any host in the zone by capacity. When it
picked a host in a cluster that cannot see the pool the caller named, the
volume check ran against whichever pool that cluster does have, and the
import failed with "Disk not found or is invalid" although the image was
fine.
Take the pod and cluster from the pool the caller passed, the same way
importVolume already derives its host from the pool's scope
* verify qemu is able to read the rbd image since check can not be done on a raw file
* use computed volumeDetails in success path as well.
* ui: do not call the imported disk a QCOW2 image
The import wizard for local and shared storage described the disk as a
QCOW2 image. An image on an RBD pool is raw, and a raw image on a file
based pool can be imported as well, so the wording is wrong for both.
Call it a disk image instead.
Only the English strings are changed; the other locales come from
Transifex.
Copy file name to clipboardExpand all lines: api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ImportVmCmd.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ public class ImportVmCmd extends ImportUnmanagedInstanceCmd {
92
92
93
93
@Parameter(name = ApiConstants.DISK_PATH,
94
94
type = CommandType.STRING,
95
-
description = "path of the disk image")
95
+
description = "path of the disk image. It is the file name on file based storage pools (NFS, Local, SharedMountPoint), and the image name on RBD storage pools")
Copy file name to clipboardExpand all lines: api/src/main/java/org/apache/cloudstack/api/command/admin/volume/ImportVolumeCmd.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ public class ImportVolumeCmd extends BaseAsyncCmd {
63
63
@Parameter(name = ApiConstants.PATH,
64
64
type = BaseCmd.CommandType.STRING,
65
65
required = true,
66
-
description = "the path of the volume")
66
+
description = "the path of the volume. It is the file name on file based storage pools (NFS, Local, SharedMountPoint), and the image name on RBD storage pools")
Copy file name to clipboardExpand all lines: engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java
Copy file name to clipboardExpand all lines: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtCheckVolumeCommandWrapper.java
+22-7Lines changed: 22 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,8 @@ public final class LibvirtCheckVolumeCommandWrapper extends CommandWrapper<Check
0 commit comments