Skip to content

Commit 6963e42

Browse files
authored
Local storage [4/4]: Use raw zvols (#9593)
Request the new *raw* zvol type when creating disks backed by local storage. Using raw zvols requires waiting for them to be initialized, which the instance start saga is now responsible for polling. Using raw zvols also requires cancelling said initialization before deleting them, which the disk delete saga is also now responsible for polling. In the instance start saga, ensure each raw zvol in parallel because this can take some time. Also in this PR is setting `volblocksize` to 128k: this was a mistake to set as if it was equivalent to the emulated device block size, and it is instead set to the default value. Still to do is to revisit the overhead reserved for zvols: the previous emperical value was not for the new raw zvol type. This is tracked by #9591. Fixes #9519.
1 parent 5292c0d commit 6963e42

10 files changed

Lines changed: 617 additions & 59 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ rustfmt-wrapper = "0.2"
716716
rustls = "0.22.2"
717717
rustls-pemfile = "2.2.0"
718718
rustyline = "14.0.0"
719+
rustix = "1.1.2"
719720
samael = { version = "0.0.19", features = ["xmlsec"] }
720721
schemars = "0.8.22"
721722
scopeguard = "1.2.0"

illumos-utils/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ uuid.workspace = true
4545
whoami.workspace = true
4646
zone.workspace = true
4747
tofino.workspace = true
48+
rustix.workspace = true
4849

4950
omicron-workspace-hack.workspace = true
5051

illumos-utils/src/dkio.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
use libc::c_int;
88
use libc::c_uint;
9+
use libc::c_ulonglong;
910
use std::io;
1011
use std::ptr;
1112

@@ -132,3 +133,18 @@ type diskaddr_t = libc::c_ulonglong;
132133
const DKIOC: c_int = 0x04 << 8;
133134
const DKIOCGMEDIAINFOEXT: c_int = DKIOC | 48;
134135
const DKIOCFLUSHWRITECACHE: c_int = DKIOC | 34;
136+
137+
// Related to raw zvols
138+
139+
pub const DKIOCRAWVOLSTATUS: libc::c_int = DKIOC | 30;
140+
pub const DKIOCRAWVOLSTOP: libc::c_int = DKIOC | 31;
141+
142+
#[derive(Debug, Default, Clone, Copy)]
143+
#[repr(C)]
144+
#[allow(non_camel_case_types)]
145+
pub struct dk_rawvol_status {
146+
pub drs_vers: c_uint,
147+
pub drs_status: c_int,
148+
pub drs_zoff: c_ulonglong,
149+
pub drs_len: c_ulonglong,
150+
}

0 commit comments

Comments
 (0)