Skip to content

Commit

Permalink
fix instance build
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcolombo committed Oct 30, 2024
1 parent 3e64a95 commit 0749318
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 9 additions & 7 deletions sled-agent/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ struct InstanceRunner {

// Properties visible to Propolis
properties: propolis_client::types::InstanceProperties,
vcpus: u8,
memory_mib: u64,

// The ID of the Propolis server (and zone) running this instance
propolis_id: PropolisUuid,
Expand Down Expand Up @@ -911,6 +913,8 @@ impl InstanceRunner {

let request = propolis_client::types::InstanceEnsureRequest {
properties: self.properties.clone(),
vcpus: self.vcpus,
memory: self.memory_mib,
nics,
disks: self
.requested_disks
Expand Down Expand Up @@ -1366,15 +1370,13 @@ impl Instance {
id: id.into_untyped_uuid(),
name: hardware.properties.hostname.to_string(),
description: "Test description".to_string(),
image_id: Uuid::nil(),
bootrom_id: Uuid::nil(),
// TODO: Align the byte type w/propolis.
memory: hardware.properties.memory.to_whole_mebibytes(),
// TODO: we should probably make propolis aligned with
// InstanceCpuCount here, to avoid any casting...
vcpus: hardware.properties.ncpus.0 as u8,
metadata,
},
// TODO: we should probably make propolis aligned with
// InstanceCpuCount here, to avoid any casting...
vcpus: hardware.properties.ncpus.0 as u8,
// TODO: Align the byte type w/propolis.
memory_mib: hardware.properties.memory.to_whole_mebibytes(),
propolis_id,
propolis_addr,
vnic_allocator,
Expand Down
6 changes: 2 additions & 4 deletions sled-agent/src/sim/sled_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,12 @@ impl SledAgent {
id: propolis_id.into_untyped_uuid(),
name: hardware.properties.hostname.to_string(),
description: "sled-agent-sim created instance".to_string(),
image_id: Uuid::default(),
bootrom_id: Uuid::default(),
memory: hardware.properties.memory.to_whole_mebibytes(),
vcpus: hardware.properties.ncpus.0 as u8,
metadata,
};
let body = propolis_client::types::InstanceEnsureRequest {
properties,
memory: hardware.properties.memory.to_whole_mebibytes(),
vcpus: hardware.properties.ncpus.0 as u8,
nics: vec![],
disks: vec![],
boot_settings: None,
Expand Down

0 comments on commit 0749318

Please sign in to comment.