Skip to content

Commit

Permalink
Add option for thick to imgtool (not implemented)
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacKhor committed May 30, 2024
1 parent f0b9d6d commit 86c45f1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/qemu-launch.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/imgtool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -97,6 +97,8 @@ int main(int argc, char **argv)
("pool", po::value<str>(), "pool where the image resides")
("size", po::value<str>()->default_value("1G"),
"size in bytes (M=2^20,G=2^30)")
("thick", po::value<bool>()->default_value(false),
"thick provision when creating an image (not currently supported)")
("dest", po::value<str>(), "destination (for clone)");
// clang-format on

Expand Down Expand Up @@ -124,7 +126,8 @@ int main(int argc, char **argv)

if (cmd == "create") {
auto size = parseint(vm["size"].as<str>());
create(io, img, size);
auto thick = vm["thick"].as<bool>();
create(io, img, size, thick);
} else if (cmd == "delete")
remove(io, img);
else if (cmd == "clone") {
Expand Down
2 changes: 1 addition & 1 deletion tools/capture-fio-perf-trace.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion tools/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 86c45f1

Please sign in to comment.