这是 OpenStack 实施经验分享系列的第 3 篇。数据库
经过上一节部署出来的 Windows instance 有时候会发现操做系统时间老是慢 8 个小时,即便手工调整好时间和时区,下次 instance 重启后又会差 8 个小时。windows
KVM 对 Linux 和 Windows 虚拟机在系统时间上处理有所不一样,Windows 须要额外一些设置。spa
给 Windows 镜像添加 os_type 属性。
glance image-update --property os_type="windows" <IMAGE-ID>
操作系统
明确指定这就是一个 windows 镜像。经过此镜像部署 instance 的时候,KVM 会在其 XML 描述文件中设置相应参数,保证时间的同步。code
对于以前部署的 Windows instance,用第一种方法就没有效果了,只能采起一点很是规手段:Hack Database!部署
假设要 hack 的 instance 的名字是 win-test,用下面的 MySQL 命令:同步
$ use nova; 虚拟机
$ update instances set os_type='windows' where hostname='win-test'; test
$ select hostname,os_type from instances where hostname='win-test'; 配置
+------------+----------+
| hostname | os_type |
+------------+----------+
| win-test | windows |
+------------+----------+
须要重启 win-test
,KVM 会获取修改后的数据库信息,更新 XML 配置,保证时间同步。
下一节继续讨论镜像使用上的经验和技巧。