@@ -304,7 +304,7 @@ impl super::Nexus {
304304 let ( .., authz_project, authz_instance) =
305305 instance_lookup. lookup_for ( authz:: Action :: Modify ) . await ?;
306306
307- let boot_device = match params. boot_device . clone ( ) {
307+ let boot_disk = match params. boot_disk . clone ( ) {
308308 Some ( disk) => {
309309 let selector = params:: DiskSelector {
310310 project : match & disk {
@@ -323,7 +323,7 @@ impl super::Nexus {
323323 None => None ,
324324 } ;
325325
326- let update = InstanceUpdate { boot_device } ;
326+ let update = InstanceUpdate { boot_disk } ;
327327 self . datastore ( )
328328 . reconfigure_instance ( opctx, & authz_instance, update)
329329 . await
@@ -467,12 +467,12 @@ impl super::Nexus {
467467 }
468468
469469 // It is deceptively inconvenient to do an early check that the boot
470- // device is valid here! We accept boot device by name or ID, but disk
470+ // disk is valid here! We accept boot disk by name or ID, but disk
471471 // creation and attachment requests as part of instance creation all
472- // require the disk name. So if the boot device is an ID, we would need
473- // to look up all attachment requests to compare the named device and
474- // to-be-attached devices . Instead, leave this for the other end of the
475- // saga when we'd go to set the boot device .
472+ // require the disk name. So if the boot disk is an ID, we would need
473+ // to look up all attachment requests to compare the named disk and
474+ // to-be-attached disks . Instead, leave this for the other end of the
475+ // saga when we'd go to set the boot disk .
476476
477477 let saga_params = sagas:: instance_create:: Params {
478478 serialized_authn : authn:: saga:: Serialized :: for_opctx ( opctx) ,
@@ -1016,7 +1016,7 @@ impl super::Nexus {
10161016 )
10171017 . await ?;
10181018
1019- let mut boot_device_name = None ;
1019+ let mut boot_disk_name = None ;
10201020
10211021 let mut disk_reqs = vec ! [ ] ;
10221022 for disk in & disks {
@@ -1054,8 +1054,8 @@ impl super::Nexus {
10541054
10551055 // Propolis wants the name of the boot disk rather than ID, because we send names
10561056 // rather than IDs in the disk requsts as assembled below.
1057- if db_instance. boot_device == Some ( disk. id ( ) ) {
1058- boot_device_name = Some ( disk. name ( ) . to_string ( ) ) ;
1057+ if db_instance. boot_disk == Some ( disk. id ( ) ) {
1058+ boot_disk_name = Some ( disk. name ( ) . to_string ( ) ) ;
10591059 }
10601060
10611061 disk_reqs. push ( sled_agent_client:: types:: DiskRequest {
@@ -1072,23 +1072,23 @@ impl super::Nexus {
10721072
10731073 // This should never occur: when setting the boot disk we ensure it is
10741074 // attached, and when detaching a disk we ensure it is not the boot
1075- // disk. If this error is seen, the instance somehow had a boot device
1076- // that was not an attached disk anyway.
1075+ // disk. If this error is seen, the instance somehow had a boot disk
1076+ // that was not attached anyway.
10771077 //
10781078 // When Propolis accepts an ID rather than name, and we don't need to
10791079 // look up a name when assembling the Propolis request, we might as well
10801080 // remove this check; we can just pass the ID and rely on Propolis' own
1081- // check that the boot device is attached.
1082- if let Some ( instance_boot_device ) = db_instance. boot_device . as_ref ( ) {
1083- if boot_device_name . is_none ( ) {
1084- error ! ( self . log, "instance boot device is not attached" ;
1085- "boot_device " => ?instance_boot_device ,
1081+ // check that the boot disk is attached.
1082+ if let Some ( instance_boot_disk ) = db_instance. boot_disk . as_ref ( ) {
1083+ if boot_disk_name . is_none ( ) {
1084+ error ! ( self . log, "instance boot disk is not attached" ;
1085+ "boot_disk " => ?instance_boot_disk ,
10861086 "instance id" => %db_instance. id( ) ) ;
10871087
10881088 return Err ( InstanceStateChangeError :: Other ( Error :: internal_error ( & format ! (
1089- "instance {} has boot device {:?} but it is not an attached disk " ,
1089+ "instance {} has boot disk {:?} but it is not attached" ,
10901090 db_instance. id( ) ,
1091- db_instance. boot_device . as_ref( ) ,
1091+ db_instance. boot_disk . as_ref( ) ,
10921092 ) ) ) ) ;
10931093 }
10941094 }
@@ -1240,7 +1240,7 @@ impl super::Nexus {
12401240 search_domains : Vec :: new ( ) ,
12411241 } ,
12421242 disks : disk_reqs,
1243- boot_order : boot_device_name . map ( |v| vec ! [ v] ) ,
1243+ boot_order : boot_disk_name . map ( |v| vec ! [ v] ) ,
12441244 cloud_init_bytes : Some ( base64:: Engine :: encode (
12451245 & base64:: engine:: general_purpose:: STANDARD ,
12461246 db_instance. generate_cidata ( & ssh_keys) ?,
@@ -2321,7 +2321,7 @@ mod tests {
23212321 network_interfaces : InstanceNetworkInterfaceAttachment :: None ,
23222322 external_ips : vec ! [ ] ,
23232323 disks : vec ! [ ] ,
2324- boot_device : None ,
2324+ boot_disk : None ,
23252325 ssh_public_keys : None ,
23262326 start : false ,
23272327 } ;
0 commit comments