-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Labels
serverRelated specifically to the Propolis server API and its VM management functions.Related specifically to the Propolis server API and its VM management functions.
Description
I borked this in #743. Relevant code:
propolis/bin/propolis-server/src/lib/spec/api_request.rs
Lines 72 to 109 in 88fbde7
| pub(super) fn parse_disk_from_request( | |
| disk: &DiskRequest, | |
| ) -> Result<ParsedStorageDevice, DeviceRequestError> { | |
| let pci_path = slot_to_pci_path(disk.slot, SlotType::Disk)?; | |
| let device_spec = match disk.device.as_ref() { | |
| "virtio" => StorageDeviceV0::VirtioDisk(VirtioDisk { | |
| backend_name: disk.name.to_string(), | |
| pci_path, | |
| }), | |
| "nvme" => StorageDeviceV0::NvmeDisk(NvmeDisk { | |
| backend_name: disk.name.to_string(), | |
| pci_path, | |
| }), | |
| _ => { | |
| return Err(DeviceRequestError::InvalidStorageInterface( | |
| disk.device.clone(), | |
| disk.slot.0, | |
| )) | |
| } | |
| }; | |
| let device_name = disk.name.clone(); | |
| let backend_name = format!("{}-backend", disk.name); | |
| let backend_spec = StorageBackendV0::Crucible(CrucibleStorageBackend { | |
| request_json: serde_json::to_string(&disk.volume_construction_request) | |
| .map_err(|e| { | |
| DeviceRequestError::SerializationError(disk.name.clone(), e) | |
| })?, | |
| readonly: disk.read_only, | |
| }); | |
| Ok(ParsedStorageDevice { | |
| device_name, | |
| device_spec, | |
| backend_name, | |
| backend_spec, | |
| }) | |
| } |
The previous version of this code used to generate the backend name up front and then use it throughout the routine, i.e., what is now on line 94 of the snippet was actually up at line 75. This breaks disk request processing because the disk devices no longer point to the registered backends.
The completed instance spec refactor will help to avoid this problem by having just one collection for disk device/backend pairs instead of distinct collections for devices and backends. For now we need a fix to unblock the metrics work we merged in #746.
Metadata
Metadata
Assignees
Labels
serverRelated specifically to the Propolis server API and its VM management functions.Related specifically to the Propolis server API and its VM management functions.