Categories

  • All news regarding Xen and XCP-ng ecosystem

    145 Topics
    5k Posts
    X
    I deferred applying the preview patches this time in order to try my luck again with RPU. Unfortunately, it did not work for me again as it has not in the past. My results are similar to others here: primary host patch application went fine including the reboot. However, once it began doing a secondary host, it started throwing errors e.g. CANNOT_EVACUATE_HOST and VM_REQUIRES_SR etc. However, manually putting the host in maintenance mode from the GUI evacuated each host just fine and I was able to apply the patches and reboot each subsequent host from the XO GUI. Also, as with others here, the RPU task hung in the task list and even a reboot of the XO VM would not clear it forcing me to delete the task using xo-cli e.g. xo-cli rest del tasks. ENVIRONMENT: Home lab consisting of 4 x Dell OptiPlex 7040 i7-6700 SFF hosts, 48GB RAM each, 10 Gbps storage connections to a TrueNAS home-built NAS via NFS and XO from source (XOS) using @ronivay build script on AlmaLinux 10.2 minimal install VM with XO commit 6a441 compiled on 2026-08-28 from master branch. FWIW, RPU functionality remains unavailable to me, though obviously, this is not a showstopper for a 4 x host home lab pool. If there is anything I can do to help resolve this, please let me know as I remain an enthusiastic proponent of the Vates virtualization stack.
  • Everything related to the virtualization platform

    1k Topics
    15k Posts
    H
    @teddyastie This is exactly the answer I was hoping for, including the parts telling me I was wrong. Thank you. Context for why I'm chasing this: with GRAID's cards, the value isn't headline throughput — it's that parity doesn't land on the host CPU. On a hypervisor that matters more than on bare metal, since cycles spent on parity are cycles unavailable to guests. I have nodes with lower base clocks where that hurts, and md's RAID5/6 path doesn't parallelise well enough to compensate with core count. Decoupling storage compute from guest compute is the whole objective. Scope note I should have led with: I don't need to boot from any of this. Dom0 can boot from a plain mirrored pair or a SATA DOM. What I need is performant data storage for guests. That drops the UEFI pre-boot and installer-visibility requirements from the VROC side, and makes storage-domain boot ordering much less severe — nothing critical is waiting on it. Taking the P2P correction. I had that as make-or-break and framed it as unfixable. If it's an ACS/platform question rather than a hypervisor one, and you've had it working between a PCI card and NVMe drives, that removes what worried me most. I'll ask Graid whether their data path ever targets BAR regions containing MSI-X tables or the PBA. Noted on custom software in Dom0, which also lands on the VROC track I'd been treating as the cheap half — I'd listed mdadm with IMSM without checking whether that's a Dom0 package change or already present. The XSM finding I ran the XSM check before any build work and hit something worth raising. This is 8.3: (XEN) XSM Framework v1.0.1 initialized (XEN) Initialising XSM SILO mode # xl getenforce Flask XSM Disabled SILO enforces that DomUs communicate only with Dom0, not with each other — no grants, no event channels between unprivileged domains. A storage driver domain is a DomU, a guest consuming its storage is a DomU, and blkback to blkfront needs grants plus an interdomain event channel with Dom0 at neither end. Unless I'm misreading silo_mode_dom_check, that's exactly what SILO denies. Which might also explain the hardcoded ssidref you queried on the PR. FLASK ships driver domain labels in its default policy; we're not running FLASK. The question is whether 9.0 keeps SILO as the default, since that's what I want to build against. I'm installing 9.0 on a bare node tonight and will post the actual output rather than leave it hypothetical. If it's still SILO, the same wall is there. Either way: can a driver domain be privileged enough to pass is_control_domain() without defeating the isolation it exists to provide, and has SILO gained driver-domain handling upstream since it landed? I'd rather be wrong about this than right. The driver domain changed my plan Mark Syms' motivation comment on #7169 describes my situation almost word for word — taking something generically available as a Linux appliance and letting it serve storage without rebuilding drivers into XenServer/XCP-ng. Graid's driver 2.0.1 already lists AlmaLinux 10.0–10.2 on kernel 6.12 as qualified. In a storage driver domain that's their existing build, unmodified: no out-of-tree module in Dom0, so no module policy question, no proprietary-vs-GPL argument, no SecureBoot complication, and none of the rebuild-per-kernel-update maintenance which I suspect was the real objection. It also gets its own vCPU allocation and can be pinned to the socket owning the PCIe root complex where the card and drives live — something Dom0 can't give me. So rather than backporting to 8.3, I'd rather build against 9.0 and carry the patch there, where xapi should sit much closer to master. Correction to my own earlier post: I said GRAID needs no SMAPI work because a virtual drive is just a local block device. True for an LVM SR in Dom0, not here — Mark is explicit that the driver domain implementation must satisfy the Storage API, and recommends SMAPIv3. With @dicode-nl having just published a working SMAPIv3 volume and datapath plugin that's tractable, but it isn't free and I shouldn't have implied otherwise. Where this leads Your mentioning storage domains sent me back to something I'd half-remembered: https://xcp-ng.org/blog/2021/07/12/dpus-and-the-future-of-virtualization/ Olivier's argument there was that offloading pre-existing software outside Dom0 — storage stack included — also shrinks Dom0's attack surface, ending with storage and networking configured through the DPU from XO while getting bare-metal performance. He signed off promising a follow-up devblog with tests and benchmarks, and I've never found where that went. It strikes me that #7169 is the missing piece. "Get the storage stack out of Dom0" needs a toolstack mechanism for serving storage from something that isn't Dom0. Once that contract exists, whether the provider is a VM on the same CPU or an Arm SoC on a card is an implementation detail. GRAID in a driver domain is the version buildable this year; a DPU-hosted provider is the same contract on different silicon. Which also answers @last-genius' concern on the PR that this would sit unused. It's the prerequisite for something Vates was publicly excited about five years ago. XCP-ng on a DPU is genuinely what I want at the end of all this. Questions Are 9.0 RPM sources and a build-env target public yet, or internal until an alpha? Would Vates consider carrying #7169 in the 9.0 line given it's upstream with two approvals, or is that a post-merge conversation? Has anyone measured blkback driver-domain overhead versus Dom0-native? That number decides whether any of this is worth pursuing. If nobody has, I'd like to produce it — I can test the plumbing with any passed-through NVMe drive, no GRAID hardware needed. On TwinStor: I suspect this doesn't compose the way I imagined, since TwinStor sits on a local block device in Dom0. Happy to hear it's a dead end now rather than later. Two bare nodes ready for 9.0 work, and I'm auditing spares for VMD-capable Xeons to see whether I can test the VROC track independently. Mike George Bitrefinery
  • 3k Topics
    29k Posts
    olivierlambertO
    @TeddyAstie you were right, and it's the bigger win. I prototyped the pipelining you described and measured it. Same rig, same 107 GiB disk, same direction as the earlier runs. Arm Wall clock vs control Peak rate Stalls A : stock behaviour 2080.8 s 1.00x 63 MiB/s 62.2% B : TCP_NODELAY only 743.8 s 2.80x 210 MiB/s 0.6% C : + pipelined writes, depth 8 377.4 s 5.51x 432 MiB/s 1.6% Pipelining is worth a further 1.97x on top of the Nagle fix. Your diagnosis was correct: the per-request reply gating, not TCP, is the dominant limit. Verified byte for byte, source and destination md5 of the 107 GiB disk both ce647d9436b48401cd4b489c955ef0f7. That mattered more than the stopwatch here, for reasons below. It's cheaper than you thought: the multiplexer already exists No NBD redesign is needed. nbd/lib/client.ml:78 is already module Rpc = Mux.Make (NbdRpc), and that multiplexer: assigns every request a unique handle (get_handle) registers a waiter in id_to_wakeup keyed by that handle serialises only the send under outgoing_mutex, then returns a promise runs a background dispatcher thread that reads replies and wakes the matching waiter So concurrent Client.write calls already interleave correctly. The whole request/reply machinery is there and unused. The serialisation is one fold_left in stream_nbd that awaits each write before pulling the next element. The rest of the chain was already fine too: Layer Verdict xapi nbdproxy Unixext.proxy, raw bidirectional byte copy, never parses NBD, cannot serialise tapdisk NBD server NBD_SERVER_NUM_REQS 8, per-client request pool destination storage fio at 2 MiB blocks: 399 MiB/s at qd=1, ~1700 MiB/s at qd=2..8, collapses at qd=16 Depth 8 matches tapdisk's pool. The fio sweep says deeper is not better. The actual trap: buffer ownership This is the part worth writing down, because it is invisible from the protocol level and it bites silently. Vhd_format.F.expand_copy allocates one 2 MiB buffer and hands out slices of it: let buffer = Memory.alloc twomib_bytes in ... let data = Cstruct.sub buffer 0 (this * 512) in really_read h (sector_start ** 512L) data >>= fun () -> return (Cons (`Sectors data, next)) It refills that same buffer on every step. The current sequential code is safe only as a side effect of awaiting each write before pulling the next element. Pipeline it naively and you get: launch write N, pull element N+1, really_read overwrites the buffer, write N puts block N+1's bytes at block N's offset. The migration completes, reports success, and the disk is corrupt. Nothing in the stack flags it. So any implementation of this needs buffer ownership solved alongside the concurrency. My prototype takes the cheap local route: a pool of depth buffers in stream_nbd, one memcpy per 2 MiB block, buffer returned only once its write completes. The proper fix is a buffer pool inside expand_copy itself, but f.ml is a shared library with other consumers, so that is a wider change than I wanted for a measurement. Prototype patch Against xapi-project/xen-api, ocaml/vhd-tool/src/impl.ml, on top of the TCP_NODELAY patch from the previous post. This is a measurement prototype, not mergeable as-is. Known gaps: progress reporting counts issued rather than completed work a failed write leaves its siblings unawaited rather than cancelled the per-block memcpy is a workaround for the shared buffer, not the right fix --- a/ocaml/vhd-tool/src/impl.ml +++ b/ocaml/vhd-tool/src/impl.ml @@ stream_nbd (if not prezeroed then expand_empty s else return s) >>= fun s -> expand_copy s >>= fun s -> + (* Pipelined writes. The NBD client already multiplexes: every request gets a + unique handle and a background dispatcher matches replies back to waiters, + so several writes may be outstanding at once. Issuing them one at a time + makes every request pay a full round trip. + + Depth 8 matches NBD_SERVER_NUM_REQS in tapdisk's NBD server. Deeper just + queues. + + Buffer ownership matters here. [expand_copy] hands out slices of a single + shared 2MiB buffer that it refills on every step, so an in-flight write + cannot keep pointing at it: pulling the next element would overwrite the + bytes before they reach the wire. Each outstanding write therefore gets a + private buffer from a pool sized to the pipeline depth, returned only once + the write has completed. *) + let depth = 8 in + let twomib = 2 * 1024 * 1024 in + let free = ref (List.init depth (fun _ -> IO.alloc twomib)) in + let inflight = ref [] in + let reap () = + match !inflight with + | [] -> + return () + | l -> + Lwt.nchoose_split (List.map fst l) >>= fun (_, pending) -> + let still, done_ = + List.partition (fun (t, _) -> List.memq t pending) l + in + inflight := still ; + free := List.map snd done_ @ !free ; + return () + in + let rec drain () = + if !inflight = [] then return () else reap () >>= fun () -> drain () + in fold_left (fun (sector, work_done) x -> ( match x with - | `Sectors data -> ( - Client.write server (Int64.mul sector 512L) [data] >>= function - | Ok () -> - return Int64.(of_int (Cstruct.length data)) - | Error _e -> - fail (Failure "Got error from NBD library") - ) + | `Sectors data -> + (* Block only when the pipeline is full. *) + (if !free = [] then reap () else return ()) >>= fun () -> + let buf = List.hd !free in + free := List.tl !free ; + let len = Cstruct.length data in + let mine = Cstruct.sub buf 0 len in + Cstruct.blit data 0 mine 0 len ; + let t = + Client.write server (Int64.mul sector 512L) [mine] >>= function + | Ok () -> + return () + | Error _e -> + fail (Failure "Got error from NBD library") + in + inflight := (t, buf) :: !inflight ; + return Int64.(of_int len) | `Empty _n -> (* must be prezeroed *) assert prezeroed ; return 0L @@ (0L, 0L) s.elements >>= fun _ -> + (* Every write must land before the stream is declared complete. *) + drain () >>= fun () -> p total_work ; return (Some total_work) Caveats on the numbers The destination SSD degrades partway through a large transfer (DRAM-less Lexar NM790, host with 3.9 GB RAM), which is why arm C starts at ~432 MiB/s and settles around 275. Arm C runs closest to that ceiling so it feels it most. On better destination storage the gap should widen, not narrow. Also worth saying: after pipelining, TCP_NODELAY matters much less, since with 8 requests in flight there is almost always at least an MSS queued. It is still correct to set it, and it is what every other NBD client in the stack does, but the 2.8x from the previous post should be read as "what you get today with a 12 line change", not as something that stacks cleanly onto the 5.5x.
  • Our hyperconverged storage solution

    50 Topics
    796 Posts
    olivierlambertO
    Great, thanks for the feedback!
  • 37 Topics
    136 Posts
    J
    @AtaxyaNetwork Merci pour tes recherches ! Oui "cd_label" serait cool comme ajout au plugin ce qui permet sur les distro type Fedora/Redhat de ne pas avoir de boot_command à gérer