@@ -281,12 +281,14 @@ impl Instance {
281
281
// NOTE: Mostly lies.
282
282
properties : propolis_client:: api:: InstanceProperties {
283
283
id,
284
- name : "Test instance" . to_string ( ) ,
284
+ name : initial_runtime . hostname . clone ( ) ,
285
285
description : "Test description" . to_string ( ) ,
286
286
image_id : Uuid :: nil ( ) ,
287
287
bootrom_id : Uuid :: nil ( ) ,
288
- memory : 256 ,
289
- vcpus : 2 ,
288
+ memory : initial_runtime. memory . to_bytes ( ) ,
289
+ // TODO: we should probably make propolis aligned with
290
+ // InstanceCpuCount here, to avoid any casting...
291
+ vcpus : initial_runtime. ncpus . 0 as u8 ,
290
292
} ,
291
293
state : InstanceStates :: new ( initial_runtime) ,
292
294
nexus_client,
@@ -477,7 +479,9 @@ mod test {
477
479
RequestContext , TypedBody ,
478
480
} ;
479
481
use futures:: future:: FutureExt ;
480
- use omicron_common:: api:: external:: { Generation , InstanceState } ;
482
+ use omicron_common:: api:: external:: {
483
+ ByteCount , Generation , InstanceCpuCount , InstanceState ,
484
+ } ;
481
485
use omicron_common:: api:: internal:: {
482
486
nexus:: InstanceRuntimeState , sled_agent:: InstanceStateRequested ,
483
487
} ;
@@ -808,6 +812,9 @@ mod test {
808
812
InstanceRuntimeState {
809
813
run_state : InstanceState :: Creating ,
810
814
sled_uuid : Uuid :: new_v4 ( ) ,
815
+ ncpus : InstanceCpuCount ( 2 ) ,
816
+ memory : ByteCount :: from_mebibytes_u32 ( 512 ) ,
817
+ hostname : "myvm" . to_string ( ) ,
811
818
gen : Generation :: new ( ) ,
812
819
time_updated : Utc :: now ( ) ,
813
820
}
0 commit comments