andrijapanicsb opened a new pull request, #13158: URL: https://github.com/apache/cloudstack/pull/13158
### Description This PR improves the KVM VM import flows by allowing operators to select the guest OS type instead of relying only on the default import template guest OS. The change covers: - Remote KVM host imports through `importVm` with `importsource=external` - KVM unmanaged instance imports through `importUnmanagedInstance` - KVM local/shared storage QCOW2 imports through `importVm` For remote and unmanaged KVM VM imports, CloudStack now parses libvirt metadata when available and exposes the detected source OS information to the UI. The UI uses this information to filter and preselect the Guest OS list where possible: - Prefer `libosinfo:os id`, for example `http://ubuntu.com/ubuntu/24.04` or `http://redhat.com/rhel/8.0` - Fall back to the libvirt domain description, for example `Debian GNU/Linux 12 (64-bit)` - Show the full Guest OS list when no useful match is found For QCOW2 imports from local/shared storage there is no source VM metadata, so the UI shows the full Guest OS list. This PR also allows optional `macaddress` and `ipaddress` parameters for KVM local/shared storage imports, so a caller can explicitly request the NIC MAC and IPv4 address when creating the imported VM from an existing disk. ### Testing - `mvn -pl api,server -am -DskipTests compile` - `mvn -pl server -am -Dtest=UnmanagedVMsManagerImplTest#importFromLocalDisk+importFromsharedStorage+testImportFromExternalTest -Dsurefire.failIfNoSpecifiedTests=false test` - `mvn -pl plugins/hypervisors/kvm -am -Dtest=LibvirtDomainXMLParserTest -Dsurefire.failIfNoSpecifiedTests=false test` - `git diff --check` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
