Skip to content

CA-393119: Don't use HTTPS for localhost migrations #5680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading