citrix xen server 虛擬機沒法關閉的問題

悲劇的一臺windows的虛擬機沒法重啓沒法關機。以下圖,一直卡住不動。windows

imageimage

首先找到這臺機器:dom

[root@xenserver-14 xen]# xe vm-list name-label=005-vss\ server 
uuid ( RO)           : 2109ad5d-ba26-d51f-aa61-326f02ded276
     name-label ( RW): 005-vss server
    power-state ( RO): running

命令行強制關機無果。ui

[root@xenserver-14 xen]# xe vm-shutdown uuid=2109ad5d-ba26-d51f-aa61-326f02ded276 force=true

重置電源狀態也行不通。spa

[root@xenserver-14 xen]# xe vm-reset-powerstate uuid=2109ad5d-ba26-d51f-aa61-326f02ded276 --force
The operation could not be performed because a domain still exists for the specified VM.
vm: 2109ad5d-ba26-d51f-aa61-326f02ded276 (005-vss server)
domid: <unknown>

看來得先取消那個卡死的任務了。首先找到任務。命令行

[root@xenserver-14 xen]# xe task-list
uuid ( RO)                : d0098f61-d056-16ba-571f-917d77cc18c4
          name-label ( RO): Connection to VM console
    name-description ( RO): 
              status ( RO): pending
            progress ( RO): 0.000


uuid ( RO)                : 43fd7023-1924-929a-5e91-6df0afbed23b
          name-label ( RO): Async.VM.clean_shutdown
    name-description ( RO): 
              status ( RO): pending
            progress ( RO): 0.000


uuid ( RO)                : 66a163a2-19e9-9add-fce2-314defe7d667
          name-label ( RO): Async.VM.hard_shutdown
    name-description ( RO): 
              status ( RO): pending
            progress ( RO): 0.000


uuid ( RO)                : fdcf42d3-e042-120e-6742-9fa8de7b4ccf
          name-label ( RO): Connection to VM console
    name-description ( RO): 
              status ( RO): pending
            progress ( RO): 0.000


uuid ( RO)                : 4d3c8f20-4a73-cd6f-07cc-f5a70279fe67
          name-label ( RO): Async.VM.hard_shutdown
    name-description ( RO): 
              status ( RO): pending
            progress ( RO): 0.000


uuid ( RO)                : 2d7c06a9-34e1-dbac-042f-cb33c9ca9a90
          name-label ( RO): Async.VM.clean_reboot
    name-description ( RO): 
              status ( RO): pending
            progress ( RO): 0.000

接下來取消之。debug

[root@xenserver-14 xen]# xe task-cancel uuid=66a163a2-19e9-9add-fce2-314defe7d667
[root@xenserver-14 xen]# xe task-cancel uuid=4d3c8f20-4a73-cd6f-07cc-f5a70279fe67
[root@xenserver-14 xen]# xe task-cancel uuid=2d7c06a9-34e1-dbac-042f-cb33c9ca9a90
[root@xenserver-14 xen]# xe task-cancel uuid=43fd7023-1924-929a-5e91-6df0afbed23b
[root@xenserver-14 xen]# xe task-list
uuid ( RO)                : d0098f61-d056-16ba-571f-917d77cc18c4
          name-label ( RO): Connection to VM console
    name-description ( RO): 
              status ( RO): pending
            progress ( RO): 0.000


uuid ( RO)                : fdcf42d3-e042-120e-6742-9fa8de7b4ccf
          name-label ( RO): Connection to VM console
    name-description ( RO): 
              status ( RO): pending
            progress ( RO): 0.000


uuid ( RO)                : 2d7c06a9-34e1-dbac-042f-cb33c9ca9a90
          name-label ( RO): Async.VM.clean_reboot
    name-description ( RO): 
              status ( RO): pending
            progress ( RO): 0.000

竟然有一個取消不掉的,那得換別的方法。code

[root@xenserver-14 xen]# list_domains
id |                                 uuid |  state
 0 | c7910908-e995-4ca4-ab25-d6d630cf0729 |     R 
35 | 62799f2c-6954-5561-9b39-fb3949432361 |     RH
48 | fd7c79bb-095b-0e6a-6fd7-96bd156907d8 |    B H
49 | 7a3ebab5-d37a-07cb-df1a-1178391604d4 |    B H
53 | 6449155a-1d8c-1acd-24d5-6fb5d9f8adac |    B H
63 | f2bc15f6-d83c-c888-8cab-a18d98f07a0f |    B H
68 | 2109ad5d-ba26-d51f-aa61-326f02ded276 |    B H
71 | b2d729ec-572b-72af-1e87-646cf78f96d1 |    B H
72 | 91585407-bcaa-0394-ce69-8aa4c320ca24 |    B H
73 | 370ec73f-4576-1171-a9df-e5c106840f95 |    B  
76 | 198eca87-0b84-a6dd-07b1-08fb4970df59 |    B H
93 | 54856655-5f69-48c0-4de4-2a26a3b31a27 |    B  
[root@xenserver-14 xen]# /opt/xensource/debug/destroy_domain -domid 68

至此機器已經處於關閉狀態了。orm

 

另外非正常關閉的通常會在啓動時出現VDI不可用的錯誤,解決方法以下:server

先根據存儲的名字找到存儲,例如:blog

xe vdi-list name-label=vip03-sys-226

而後使用下面命令分離:

xe vdi-forget uuid=xxxx存儲的uuid

這是虛擬機的存儲中就沒有這個存儲了,再到存儲設備裏點擊從新掃描,等掃描出來後再到vm的存儲界面經過鏈接磁盤添加存儲。

相關文章
相關標籤/搜索