Skip to content

Commit

Permalink
Do not assume IPv4 when disabling management (#6012)
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
  • Loading branch information
robhoes authored Sep 24, 2024
2 parents 1bafd51 + 29685fb commit 150f62f
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 _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 150f62f

Please sign in to comment.