---
title: "CloudStack SSVM 启动不了，可执行如下查询sql来确定"
author: "liuye"
date: "2012-10-16T14:56:39Z"
tags: []
categories: ["企业架构"]
slug: "cloudstack-ssvm-sql"
draft: false
lastmod: "2012-10-16T14:58:13Z"
id: 1699262
url: "https://liuye.iteye.com/blog/1699262"
---

SSVM 启动不了，可执行如下查询sql来确定

get zone template  
select a.* from vm\_template a, host h where h.type = 'Routing' and h.data\_center\_id = 1 and a.type = 'System' and a.hypervisor\_type  = h.hypervisor\_type limit 1;   #templateid is 1

get zone secondary storage  
select * from host where type = 'SecondaryStorage' and data\_center\_id = 1;  # host id is 3

get zone template and host ref        
select * from template\_host\_ref where host\_id = 3 and template\_id = 1 and download\_state = 'DOWNLOADED'; # host id and template id  is query by before.

get host primary storage pool  
SELECT p.data\_center\_id,  count(ph.host\_id) count  FROM storage\_pool p, storage\_pool\_host\_ref ph WHERE p.id = ph.pool\_id AND  p.data\_center\_id = 1 GROUP by p.data\_center\_id;  
count need bigger than 0;  
这个是ssvm不启动的时候原因查找，这个是查询问题的，查询出问题，解决相应问题，CS会自动启动SSVM的