citrix xen server 虚拟机无法关闭的问题

悲剧的一台windows的虚拟机无法重启无法关机。如下图,一直卡住不动。

imageimage

首先找到这台机器:

[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

命令行强制关机无果。

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

重置电源状态也行不通。

[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

接下来取消之。

[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

居然有一个取消不掉的,那得换别的方法。

[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

至此机器已经处于关闭状态了。

 

另外非正常关闭的一般会在启动时出现VDI不可用的错误,解决方法如下:

先根据存储的名字找到存储,例如:

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

然后使用下面命令分离:

xe vdi-forget uuid=xxxx存储的uuid

这是虚拟机的存储中就没有这个存储了,再到存储设备里点击重新扫描,等扫描出来后再到vm的存储界面通过连接磁盘添加存储。

posted @ 2013-09-17 15:35  lt1983  阅读(3596)  评论(0编辑  收藏  举报