-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Added vddk support in vmware to kvm migrations #12970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.22
Are you sure you want to change the base?
Changes from all commits
7dc5d50
d380447
fbd8082
cb42c2f
ababa52
7fb0b85
2976142
e35d12e
5740e8a
50e4ebc
b4acbc3
8843062
64f1610
5c3993f
90ddb19
ab914bf
6b3dc07
aa710bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -808,6 +808,37 @@ public Property<Integer> getWorkers() { | |||
| */ | ||||
| public static final Property<String> CONVERT_ENV_VIRTV2V_TMPDIR = new Property<>("convert.instance.env.virtv2v.tmpdir", null, String.class); | ||||
|
|
||||
| /** | ||||
| * Path to the VDDK library directory on the KVM conversion host, used when converting VMs from VMware to KVM via VDDK. | ||||
| * This directory is passed to virt-v2v as <code>-io vddk-libdir=<path></code>. | ||||
| * Data type: String.<br> | ||||
| * Default value: <code>null</code> | ||||
| */ | ||||
| public static final Property<String> VDDK_LIB_DIR = new Property<>("vddk.lib.dir", null, String.class); | ||||
|
|
||||
| /** | ||||
| * Value for the LIBGUESTFS_BACKEND env var used during VMware to KVM conversion via VDDK. | ||||
| * Data type: String.<br> | ||||
| * Default value: <code>direct</code> | ||||
| */ | ||||
| public static final Property<String> LIBGUESTFS_BACKEND = new Property<>("libguestfs.backend", "direct", String.class); | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
|
|
||||
| /** | ||||
| * Ordered list of VDDK transports for virt-v2v, passed as <code>-io vddk-transports=<value></code>. | ||||
| * Example: <code>nbd:nbdssl</code>. | ||||
| * Data type: String.<br> | ||||
| * Default value: <code>null</code> | ||||
| */ | ||||
| public static final Property<String> VDDK_TRANSPORTS = new Property<>("vddk.transports", null, String.class); | ||||
|
|
||||
| /** | ||||
| * vCenter TLS certificate thumbprint used by virt-v2v VDDK mode, passed as <code>-io vddk-thumbprint=<value></code>. | ||||
| * If unset, the KVM host computes it at runtime from the vCenter endpoint. | ||||
| * Data type: String.<br> | ||||
| * Default value: <code>null</code> | ||||
| */ | ||||
| public static final Property<String> VDDK_THUMBPRINT = new Property<>("vddk.thumbprint", null, String.class); | ||||
|
|
||||
| /** | ||||
| * BGP controll CIDR | ||||
| * Data type: String.<br> | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -31,6 +31,11 @@ public class ConvertInstanceCommand extends Command { | |||
| private boolean exportOvfToConversionLocation; | ||||
| private int threadsCountToExportOvf = 0; | ||||
| private String extraParams; | ||||
| private boolean useVddk; | ||||
| private String libguestfsBackend; | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| private String vddkLibDir; | ||||
| private String vddkTransports; | ||||
| private String vddkThumbprint; | ||||
|
|
||||
| public ConvertInstanceCommand() { | ||||
| } | ||||
|
|
@@ -90,6 +95,46 @@ public void setExtraParams(String extraParams) { | |||
| this.extraParams = extraParams; | ||||
| } | ||||
|
|
||||
| public boolean isUseVddk() { | ||||
| return useVddk; | ||||
| } | ||||
|
|
||||
| public void setUseVddk(boolean useVddk) { | ||||
| this.useVddk = useVddk; | ||||
| } | ||||
|
|
||||
| public String getLibguestfsBackend() { | ||||
| return libguestfsBackend; | ||||
| } | ||||
|
|
||||
| public void setLibguestfsBackend(String libguestfsBackend) { | ||||
| this.libguestfsBackend = libguestfsBackend; | ||||
| } | ||||
|
|
||||
| public String getVddkLibDir() { | ||||
| return vddkLibDir; | ||||
| } | ||||
|
|
||||
| public void setVddkLibDir(String vddkLibDir) { | ||||
| this.vddkLibDir = vddkLibDir; | ||||
| } | ||||
|
|
||||
| public String getVddkTransports() { | ||||
| return vddkTransports; | ||||
| } | ||||
|
|
||||
| public void setVddkTransports(String vddkTransports) { | ||||
| this.vddkTransports = vddkTransports; | ||||
| } | ||||
|
|
||||
| public String getVddkThumbprint() { | ||||
| return vddkThumbprint; | ||||
| } | ||||
|
|
||||
| public void setVddkThumbprint(String vddkThumbprint) { | ||||
| this.vddkThumbprint = vddkThumbprint; | ||||
| } | ||||
|
|
||||
| @Override | ||||
| public boolean executeInSequence() { | ||||
| return false; | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -805,8 +805,11 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi | |
| String uefiEnabled = detailsMap.get(Host.HOST_UEFI_ENABLE); | ||
| String virtv2vVersion = detailsMap.get(Host.HOST_VIRTV2V_VERSION); | ||
| String ovftoolVersion = detailsMap.get(Host.HOST_OVFTOOL_VERSION); | ||
| String vddkSupport = detailsMap.get(Host.HOST_VDDK_SUPPORT); | ||
| String vddkLibDir = detailsMap.get(Host.HOST_VDDK_LIB_DIR); | ||
| String vddkVersion = detailsMap.get(Host.HOST_VDDK_VERSION); | ||
| logger.debug("Got HOST_UEFI_ENABLE [{}] for host [{}]:", uefiEnabled, host); | ||
| if (ObjectUtils.anyNotNull(uefiEnabled, virtv2vVersion, ovftoolVersion)) { | ||
| if (ObjectUtils.anyNotNull(uefiEnabled, virtv2vVersion, ovftoolVersion, vddkSupport, vddkLibDir, vddkVersion)) { | ||
| _hostDao.loadDetails(host); | ||
| boolean updateNeeded = false; | ||
| if (StringUtils.isNotBlank(uefiEnabled) && !uefiEnabled.equals(host.getDetails().get(Host.HOST_UEFI_ENABLE))) { | ||
|
|
@@ -821,6 +824,26 @@ protected AgentAttache notifyMonitorsOfConnection(final AgentAttache attache, fi | |
| host.getDetails().put(Host.HOST_OVFTOOL_VERSION, ovftoolVersion); | ||
| updateNeeded = true; | ||
| } | ||
| if (StringUtils.isNotBlank(vddkSupport) && !vddkSupport.equals(host.getDetails().get(Host.HOST_VDDK_SUPPORT))) { | ||
| host.getDetails().put(Host.HOST_VDDK_SUPPORT, vddkSupport); | ||
| updateNeeded = true; | ||
| } | ||
| if (!StringUtils.defaultString(vddkLibDir).equals(StringUtils.defaultString(host.getDetails().get(Host.HOST_VDDK_LIB_DIR)))) { | ||
| if (StringUtils.isBlank(vddkLibDir)) { | ||
| host.getDetails().remove(Host.HOST_VDDK_LIB_DIR); | ||
| } else { | ||
| host.getDetails().put(Host.HOST_VDDK_LIB_DIR, vddkLibDir); | ||
| } | ||
| updateNeeded = true; | ||
| } | ||
| if (!StringUtils.defaultString(vddkVersion).equals(StringUtils.defaultString(host.getDetails().get(Host.HOST_VDDK_VERSION)))) { | ||
| if (StringUtils.isBlank(vddkVersion)) { | ||
| host.getDetails().remove(Host.HOST_VDDK_VERSION); | ||
| } else { | ||
| host.getDetails().put(Host.HOST_VDDK_VERSION, vddkVersion); | ||
| } | ||
| updateNeeded = true; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need all these params in host_details? Persisting Host.HOST_VDDK_VERSION should be enough when vddk lib is properly set, to indicate vddk support.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Version identification is not just enough to claim the support but we will also need the directory where it is located as we need to pass that in the virt-v2v command with vddk. |
||
| } | ||
| if (updateNeeded) { | ||
| _hostDao.saveDetails(host); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.