Skip to content

Commit 86ed52a

Browse files
committed
update usage.md to add NBD section
add documentation to explain how to use the new NetworkBlockDevice device. Args list and examples are provided in the usage.md file Signed-off-by: Luca Stocchi <[email protected]>
1 parent 7eb93d8 commit 86ed52a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

doc/usage.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,28 @@ This adds a read only USB mass storage device to the VM which will be backed by
223223
--device usb-mass-storage,path=/Users/virtuser/distro.iso,readonly
224224
```
225225

226+
### Network Block Device
227+
228+
#### Description
229+
230+
The `--device nbd` option allows to connect to a remote NBD server, effectively accessing a remote block device over the network as if it were a local disk.
231+
232+
The NBD client running on the VM is informed in case the connection drops and it tries to reconnect automatically to the server.
233+
234+
#### Arguments
235+
- `uri`: the URI that refers to the NBD server to which the NBD client will connect, e.g. `nbd://10.10.2.8:10000/export`. More info at https://github.com/NetworkBlockDevice/nbd/blob/master/doc/uri.md
236+
- `deviceId`: `/dev/disk/by-id/virtio-` identifier to use for this device.
237+
- `sync`: the mode in which the NBD client synchronizes data with the NBD server. It can be `full`or `none`, more info at https://developer.apple.com/documentation/virtualization/vzdisksynchronizationmode?language=objc
238+
- `timeout`: the timeout value in milliseconds for the connection between the client and server
239+
- `readonly`: if specified the device will be read only.
240+
241+
#### Example
242+
243+
This allows to connect to the export of the remote NBD server:
244+
```
245+
--device nbd,uri=nbd://192.168.64.4:11111/export,deviceId=nbd1,timeout=3000
246+
```
247+
226248

227249
### Networking
228250

0 commit comments

Comments
 (0)