# 操作手册

从内蒙的开发者门户上（`http://10.142.233.181:8099/index.html#/`），进入`应用管理 -> 应用列表 -> 云桌面 -> openstack源码`，从这里跳转到gogs地址，然后下载master分支最新的源码压缩包`openstack-master.tar.gz`

## 一、更新数据库（controller节点）

`openstack-master.tar.gz`里面有一个`nova.sql`，里面的内容如下：

```
alter table nova.instance_extra add ca_cert text;
alter table nova.instance_extra add server_cert text;
alter table nova.instance_extra add server_key text;
alter table nova.instance_extra add client_cert text;

alter table nova_cell0.instance_extra add ca_cert text;
alter table nova_cell0.instance_extra add server_cert text;
alter table nova_cell0.instance_extra add server_key text;
alter table nova_cell0.instance_extra add client_cert text;
```

连上数据库，执行该sql脚本，为`nova`与`nova_cell0`这个两个`database`的`instance_extra`表添加`ca_cert`、`server_cert`、`serverk_key`、`client_cert`四个字段。

## 二、更新libvirt（compute节点）

首先，先卸载`libvirt-daemon-driver-qemu`：

```
$ sudo yum -y remove libvirt-daemon-driver-qemu
```

注意，由于`openstack-nova-compute`依赖于该软件，所以卸载它也会导致`openstack-nova-compute`被卸载，那么需要重新安装`openstack-nova-compute`

然后安装我们自已编译好的这个rpm包（在`openstack-master.tar.gz`的`libvirt/rpm/`目录下）

```
$ sudo yum -y localinstall libvirt-daemon-driver-qemu-4.5.0-10.el7_6.6.x86_64.rpm
```

然后再重新安装`openstack-nova-compute`

> 当然，如果每一次都先卸载原始的libvirt-daemon-driver-qemu再安装会比较麻烦，待测试稳定后，可以把自已编译好的包加入到yum源中。当然，自已编译的包的版本，一定要是最新的，因为安装openstack-nova-compute时会安装最新的libvirt-daemon-driver-qemu

## 三、更新openstack-nova-compute（compute节点）

在`openstack-master.tar.gz`上有一个`patch.sh`，执行该脚本:

```
$ sudo ./patch.sh
```

然后重启`openstack-nova-compute`服务


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pshizhsysu.gitbook.io/openstack/spicezheng-shu-guan-li/cao-zuo-shou-ce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
