Skip to content

Commit

Permalink
Do not assume IPv4 when disabling management
Browse files Browse the repository at this point in the history
Instead look at the inventory to decide the address type,
this will avoid to override the value in the inventory
when its rewritten

Signed-off-by: Benjamin Reis <[email protected]>
  • Loading branch information
benjamreis committed Sep 24, 2024
1 parent 9bfcc40 commit e9e26e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ocaml/xapi/xapi_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,11 @@ let management_disable ~__context =
raise
(Api_errors.Server_error (Api_errors.slave_requires_management_iface, [])) ;
(* Reset the management server *)
Xapi_mgmt_iface.change "" `IPv4 ;
let management_address_type =
Record_util.primary_address_type_of_string
(Xapi_inventory.lookup Xapi_inventory._management_address_type)
in
Xapi_mgmt_iface.change "" management_address_type ;
Xapi_mgmt_iface.run ~__context ~mgmt_enabled:false () ;
(* Make sure all my PIFs are marked appropriately *)
Xapi_pif.update_management_flags ~__context
Expand Down

0 comments on commit e9e26e1

Please sign in to comment.