Skip to content

Commit

Permalink
Fix a few VDDK-related nbdkit issues. (#2341)
Browse files Browse the repository at this point in the history
* Fix initImageURL example.

Trying the example as written does not work, there should be no HTTP
prefix.

Signed-off-by: Matthew Arnold <marnold@redhat.com>

* Correct VDDK search path.

Remove LD_LIBRARY_PATH and point to base vmware-vix-disklib-distrib
directory as recommended in nbdkit documentation. Without this, CDI's
version of nbdkit fails with:

"/opt/vmware-vix-disklib-distrib/lib64/lib64/libvixDiskLib.so.7: cannot
open shared object file: No such file or directory"

Signed-off-by: Matthew Arnold <marnold@redhat.com>

* Add sqlite-libs to VDDK importer extras.

Without this, VDDK imports cause nbdkit to fail with:

"libsqlite3.so.0: cannot open shared object file: No such file or
directory"

Signed-off-by: Matthew Arnold <marnold@redhat.com>

* Add cacheextents filter to VDDK imports.

This reduces the time it takes to get VDDK transfers started, in some
cases pretty significantly (~25 seconds down to ~5 seconds in one test).

Signed-off-by: Matthew Arnold <marnold@redhat.com>

* Fix lint error.

Signed-off-by: Matthew Arnold <marnold@redhat.com>
  • Loading branch information
mrnold committed Jun 29, 2022
1 parent cbb4390 commit ee230ec
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/datavolumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ spec:
uuid: "52260566-b032-36cb-55b1-79bf29e30490"
thumbprint: "20:6C:8A:5D:44:40:B3:79:4B:28:EA:76:13:60:90:6E:49:D9:D9:A3" # SSL fingerprint of vCenter/ESX host
secretRef: "vddk-credentials"
initImageURL: "http://registry:5000/vddk-init:latest"
initImageURL: "registry:5000/vddk-init:latest"
pvc:
accessModes:
- ReadWriteOnce
Expand Down
1 change: 1 addition & 0 deletions hack/build/rpm-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ qemu-img

cdi_importer_extra_x86_64="
nbdkit-vddk-plugin
sqlite-libs
"

cdi_uploadserver="
Expand Down
13 changes: 7 additions & 6 deletions pkg/image/nbdkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

const (
nbdVddkLibraryPath = "/opt/vmware-vix-disklib-distrib/lib64"
nbdVddkLibraryPath = "/opt/vmware-vix-disklib-distrib"
startupTimeoutSeconds = 15
)

Expand Down Expand Up @@ -48,10 +48,11 @@ const (

// Nbdkit filters
const (
NbdkitXzFilter NbdkitFilter = "xz"
NbdkitTarFilter NbdkitFilter = "tar"
NbdkitGzipFilter NbdkitFilter = "gzip"
NbdkitRetryFilter NbdkitFilter = "retry"
NbdkitXzFilter NbdkitFilter = "xz"
NbdkitTarFilter NbdkitFilter = "tar"
NbdkitGzipFilter NbdkitFilter = "gzip"
NbdkitRetryFilter NbdkitFilter = "retry"
NbdkitCacheExtentsFilter NbdkitFilter = "cacheextents"
)

// Nbdkit represents struct for an nbdkit instance
Expand Down Expand Up @@ -147,8 +148,8 @@ func NewNbdkitVddk(nbdkitPidFile, socket, server, username, password, thumbprint
Socket: socket,
}

n.AddEnvVariable("LD_LIBRARY_PATH=" + nbdVddkLibraryPath)
n.AddFilter(NbdkitRetryFilter)
n.AddFilter(NbdkitCacheExtentsFilter)
if err := n.validatePlugin(); err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions rpm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ rpmtree(
"@readline-0__8.1-4.el9.x86_64//rpm",
"@sed-0__4.8-9.el9.x86_64//rpm",
"@setup-0__2.13.7-6.el9.x86_64//rpm",
"@sqlite-libs-0__3.34.1-5.el9.x86_64//rpm",
"@systemd-libs-0__250-4.el9.x86_64//rpm",
"@tar-2__1.34-3.el9.x86_64//rpm",
"@tzdata-0__2021e-1.el9.x86_64//rpm",
Expand Down

0 comments on commit ee230ec

Please sign in to comment.