diff --git a/README.md b/README.md index 057eb940..be3218f7 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Parameters are: - `batch_size`, `LSVD_BATCH_SIZE`: size of objects written to the backend, in bytes (K/M recognized as 1024, 1024\*1024). Default: 8MiB - `wcache_batch`: write cache batching (see below) - `wcache_chunk': maximum size of atomic write, in bytes - larger writes will be split and may be non-atomic. -- `rcache_dir` - directory used for read cache file and GC temporary files. Note that `lsvd_imgtool` can format a partition for cache and symlink it into this directory, although the performance improvement seems limited. +- `rcache_dir` - directory used for read cache file and GC temporary files. Note that `imgtool` can format a partition for cache and symlink it into this directory, although the performance improvement seems limited. - `wcache_dir` - directory used for write cache file - `xlate_window`: max writes (i.e. objects) in flight to the backend. Note that this value is coupled to the size of the write cache, which must be big enough to hold all outstanding writes in case of a crash. - `hard_sync` (untested): "flush" forces all batched writes to the backend. @@ -70,7 +70,7 @@ figure out how to optimize at runtime instead of bothering the user for a value. First create a volume: ``` -build$ sudo bin/lsvd_imgtool --create --rados --size=20g pool/imgname +build$ sudo imgtool create poolname imgname --size=20g ``` Then you can start a SPDK NVMe-oF gateway: @@ -158,21 +158,17 @@ The read cache typically fetches 64K blocks, so there may be a bit of extra load Most of the testing to date has been with an 8,3 code with 64K stripe size. ## Tools -`lsvd_imgtool` mostly just calls the LSVD versions of `rbd_create` and `rbd_remove`, although it can also format a cache file (e.g. if you're using a raw partition) -``` -build$ bin/lsvd_imgtool --help -Usage: lsvd_imgtool [OPTION...] -IMAGE - -C, --create create image - -d, --cache-dir=DIR cache directory - -D, --delete delete image - -I, --info show image information - -k, --mkcache=DEV use DEV as cache - -O, --rados use RADOS - -z, --size=SIZE size in bytes (M/G=2^20,2^30) - -?, --help Give this help list - --usage Give a short usage message +``` +build$ ./imgtool --help +❯ ./imgtool --help +Allowed options: + --help produce help message + --cmd arg subcommand: create, clone, delete, info + --img arg name of the iname + --pool arg pool where the image resides + --size arg (=1G) size in bytes (M=2^20,G=2^30) + --dest arg destination (for clone) ``` Other tools live in the `tools` subdirectory - see the README there for more details. diff --git a/docs/qemu-launch.md b/docs/qemu-launch.md index 13995164..0f7dfd4a 100644 --- a/docs/qemu-launch.md +++ b/docs/qemu-launch.md @@ -5,7 +5,7 @@ install config, run QEMU with `-drive format=raw,file=seed.iso,cache=none,if=virtio`. 1. Create a lsvd image if you don't already have one: - `./imgtool --create --rados --size 10g $pool_name/$img_name` + `./imgtool create --size 10g $pool_name $img_name` 2. Launch LSVD as a NVMF target `qemu-gateway.bash $pool_name $img_name` 3. Lanuch QEMU with the NVMF target `qemu-client.bash`. This does the following: - `nvme connect` to the nvmf target on the gateway diff --git a/src/imgtool.cc b/src/imgtool.cc index 0e6e52d6..00c030df 100644 --- a/src/imgtool.cc +++ b/src/imgtool.cc @@ -31,7 +31,7 @@ static usize parseint(str i) return val; } -static void create(rados_ioctx_t io, str name, usize size) +static void create(rados_ioctx_t io, str name, usize size, bool thick) { auto rc = lsvd_image::create_new(name, size, io); THROW_MSG_ON(rc != 0, "Failed to create new image '{}'", name); @@ -97,6 +97,8 @@ int main(int argc, char **argv) ("pool", po::value(), "pool where the image resides") ("size", po::value()->default_value("1G"), "size in bytes (M=2^20,G=2^30)") + ("thick", po::value()->default_value(false), + "thick provision when creating an image (not currently supported)") ("dest", po::value(), "destination (for clone)"); // clang-format on @@ -124,7 +126,8 @@ int main(int argc, char **argv) if (cmd == "create") { auto size = parseint(vm["size"].as()); - create(io, img, size); + auto thick = vm["thick"].as(); + create(io, img, size, thick); } else if (cmd == "delete") remove(io, img); else if (cmd == "clone") { diff --git a/tools/capture-fio-perf-trace.bash b/tools/capture-fio-perf-trace.bash index ed744cc4..a40b16f7 100755 --- a/tools/capture-fio-perf-trace.bash +++ b/tools/capture-fio-perf-trace.bash @@ -9,7 +9,7 @@ make clean make -j$(nproc) release ./tools/remove_objs.py pone perf-fio -# ./imgtool --rados --create --size=1G pone/perf-fio +# ./imgtool create --size 1G pone perf-fio ./thick-image --size=10G pone/perf-fio cd test/ diff --git a/tools/utils.bash b/tools/utils.bash index 0aaee13a..d925844a 100644 --- a/tools/utils.bash +++ b/tools/utils.bash @@ -101,7 +101,7 @@ function create_lsvd_thin { # ./builddir/imgtool --delete --rados $pool/$img || true ./tools/remove_objs.py $pool $img - ./builddir/imgtool --create --rados --size=$size $pool/$img + ./builddir/imgtool create --size $size $pool $img # make sure image exists rados -p $pool stat $img