Skip to content

Commit

Permalink
Merge pull request #5680 from robhoes/ca393119
Browse files Browse the repository at this point in the history
CA-393119: Don't use HTTPS for localhost migrations
  • Loading branch information
robhoes authored Jun 11, 2024
2 parents e92064a + 31564ab commit 1ea39d8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ocaml/xapi/xapi_vm_migrate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ let infer_vgpu_map ~__context ?remote vm =
let pool_migrate ~__context ~vm ~host ~options =
Pool_features.assert_enabled ~__context ~f:Features.Xen_motion ;
let dbg = Context.string_of_task __context in
let localhost = Helpers.get_localhost ~__context in
if host = localhost then
info "This is a localhost migration" ;
let open Xapi_xenops_queue in
let queue_name = queue_of_vm ~__context ~self:vm in
let module XenopsAPI = (val make_client queue_name : XENOPS) in
Expand All @@ -395,11 +398,14 @@ let pool_migrate ~__context ~vm ~host ~options =
.assert_valid_ip_configuration_on_network_for_host ~__context
~self:network ~host
in
let compress =
use_compression ~__context options (Helpers.get_localhost ~__context) host
in
let compress = use_compression ~__context options localhost host in
debug "%s using stream compression=%b" __FUNCTION__ compress ;
let http = if !Xapi_globs.migration_https_only then "https" else "http" in
let http =
if !Xapi_globs.migration_https_only && host <> localhost then
"https"
else
"http"
in
let xenops_url =
Uri.(
make ~scheme:http ~host:address ~path:"/services/xenops"
Expand Down

0 comments on commit 1ea39d8

Please sign in to comment.