Skip to content

CA-404611: Fix SXM when VM is shut down midway #6246

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 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions ocaml/sdk-gen/csharp/XE_SR_ERRORCODES.xml
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,11 @@
<description>A Failure occurred accessing an API object</description>
<value>153</value>
</code>
<code>
<name>APIProtocolError</name>
<description>A protocol error was received when accessing the API</description>
<value>154</value>
</code>

<!-- Netapp Specific Error codes -->
<code>
Expand Down
6 changes: 4 additions & 2 deletions ocaml/xapi/import.ml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ type config = {
let is_live config =
match config.import_type with Metadata_import {live; _} -> live | _ -> false

let needs_cpu_check config =
let needs_cpu_check config vm_record =
vm_record.API.vM_power_state <> `Halted
&&
match config.import_type with
| Metadata_import {check_cpu; _} ->
check_cpu
Expand Down Expand Up @@ -519,7 +521,7 @@ module VM : HandlerTools = struct
| Replace (_, vm_record) | Clean_import vm_record ->
if is_live config then
assert_can_live_import __context vm_record ;
( if needs_cpu_check config then
( if needs_cpu_check config vm_record then
let vmm_record =
find_in_export
(Ref.string_of vm_record.API.vM_metrics)
Expand Down
2 changes: 1 addition & 1 deletion ocaml/xapi/xapi_vm_migrate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,6 @@ let migrate_send' ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~vgpu_map
We look at the VDIs of the VM, the VDIs of all of the snapshots, and any
suspend-image VDIs. *)
let vm_uuid = Db.VM.get_uuid ~__context ~self:vm in
let power_state = Db.VM.get_power_state ~__context ~self:vm in
let vbds = Db.VM.get_VBDs ~__context ~self:vm in
let vifs = Db.VM.get_VIFs ~__context ~self:vm in
let snapshots = Db.VM.get_snapshots ~__context ~self:vm in
Expand Down Expand Up @@ -1466,6 +1465,7 @@ let migrate_send' ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~vgpu_map
)
vgpu_map
in
let power_state = Db.VM.get_power_state ~__context ~self:vm in
inter_pool_metadata_transfer ~__context ~remote ~vm ~vdi_map
~vif_map ~vgpu_map ~dry_run:false ~live:true ~copy
~check_cpu:((not force) && power_state <> `Halted)
Expand Down
Loading