Skip to content

Commit 0286ff0

Browse files
authored
CA-418960: VM with vTPM Delete doesn't remove the snapshot (#6718)
The snapshot of VM with vTPM are VM object in `Suspended state, During destory of the VM object, it would expect the VM in state of `Halted, thus, cuase the snapshot can not be destoryed. Instead of expect the VM in `Halted state, the VM is espected in not alive state, e.g: `Suspended or `Halted
2 parents 61792e7 + c3b285d commit 0286ff0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ocaml/xapi/xapi_vtpm.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ let copy ~__context ~vM ref =
8585

8686
let destroy ~__context ~self =
8787
let vm = Db.VTPM.get_VM ~__context ~self in
88-
Xapi_vm_lifecycle.assert_initial_power_state_is ~__context ~self:vm
89-
~expected:`Halted ;
88+
Xapi_vm_lifecycle.assert_initial_power_state_in ~__context ~self:vm
89+
~allowed:[`Halted; `Suspended] ;
9090
let secret = Db.VTPM.get_contents ~__context ~self in
9191
Db.Secret.destroy ~__context ~self:secret ;
9292
Db.VTPM.destroy ~__context ~self

0 commit comments

Comments
 (0)