FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Restrict VDDK check on filesystem only when the agent property for VDDK is set by nvazquez · Pull Request #14688 · apache/cloudstack · GitHub

Repository navigation

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
public static final String WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "rpm -qa | grep -i virtio-win";
public static final String UBUNTU_WINDOWS_GUEST_CONVERSION_SUPPORTED_CHECK_CMD = "dpkg -l virtio-win";
public static final String UBUNTU_NBDKIT_PKG_CHECK_CMD = "dpkg -l nbdkit";
public static final String VDDK_AUTODETECT_PATH_CMD = "find / -type d -name 'vmware-vix-disklib-distrib' 2>/dev/null | head -n 1";

public static final int LIBVIRT_CGROUP_CPU_SHARES_MIN = 2;
public static final int LIBVIRT_CGROUP_CPU_SHARES_MAX = 262144;
Expand Down Expand Up @@ -1188,20 +1187,16 @@ public boolean configure(final String name, final Map<String, Object> params) th
LOGGER.warn("Configured VDDK library dir [{}] is invalid (missing lib64/libvixDiskLib.so), attempting auto-detection", vddkLibDir);
vddkLibDir = null;
}
if (StringUtils.isBlank(vddkLibDir)) {
vddkLibDir = detectVddkLibDir();
}
if (StringUtils.isNotBlank(vddkLibDir)) {
LOGGER.info("Detected VDDK library dir: {}", vddkLibDir);
vddkVersion = detectVddkVersion();
if (StringUtils.isNotBlank(vddkVersion)) {
LOGGER.info("Detected nbdkit VDDK plugin version: {}", vddkVersion);
}
} else {
LOGGER.warn("Could not detect a valid VDDK library dir; VDDK conversion will be unavailable");
}

vddkVersion = detectVddkVersion();
if (StringUtils.isNotBlank(vddkVersion)) {
LOGGER.info("Detected nbdkit VDDK plugin version: {}", vddkVersion);
}

vddkTransports = StringUtils.trimToNull(
AgentPropertiesFileHandler.getPropertyValue(AgentProperties.VDDK_TRANSPORTS));
vddkThumbprint = StringUtils.trimToNull(
Expand Down Expand Up @@ -6013,9 +6008,6 @@ public boolean hostSupportsVddk(String overriddenVddkLibDir) {
if (StringUtils.isBlank(effectiveVddkLibDir)) {
effectiveVddkLibDir = StringUtils.trimToNull(vddkLibDir);
}
if (StringUtils.isBlank(effectiveVddkLibDir) || !isVddkLibDirValid(effectiveVddkLibDir)) {
effectiveVddkLibDir = detectVddkLibDir();
}
return hostSupportsInstanceConversion() && isVddkLibDirValid(effectiveVddkLibDir) && StringUtils.isNotBlank(detectVddkVersion());
}

Expand All @@ -6031,14 +6023,6 @@ protected boolean isVddkLibDirValid(String path) {
return libs != null && libs.length > 0;
}

protected String detectVddkLibDir() {
String detectedPath = StringUtils.trimToNull(Script.runSimpleBashScript(VDDK_AUTODETECT_PATH_CMD));
if (StringUtils.isNotBlank(detectedPath) && isVddkLibDirValid(detectedPath)) {
return detectedPath;
}
return null;
}

protected String detectVddkVersion() {
try {
ProcessBuilder pb = new ProcessBuilder("nbdkit", "vddk", "--version");
Expand Down
Loading

Back | FazBrowse Home | New Git URL