Skip to content

Commit

Permalink
When reseting an host network: keep the primary address type
Browse files Browse the repository at this point in the history
By default when recreating the PIF etc the address type is IPv4
Look what it was before and reput it after the PIF recreation

Signed-off-by: Benjamin Reis <[email protected]>
  • Loading branch information
benjamreis committed Sep 20, 2024
1 parent f51e7e7 commit adc6a5c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ocaml/xapi/xapi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,14 @@ let check_network_reset () =
| [] ->
error "management PIF %s not found" device
| phy_pif :: _ ->
(* Keep previsous management address type *)
let management_address_type =
Record_util.primary_address_type_of_string
(Xapi_inventory.lookup Xapi_inventory._management_address_type)
in
Xapi_host.management_disable ~__context ;
Xapi_pif.set_primary_address_type ~__context ~self:phy_pif
~primary_address_type:management_address_type ;
let pif =
match vlan with
| Some vlan ->
Expand Down

0 comments on commit adc6a5c

Please sign in to comment.