openstack 相关笔记

1,apt-get install kvm libvirt-bin virtinst,装完后,你用ifconfig,就会发现多了一个virbr0 的bridge。
数据库

2,Note that OVS bridges br-int and br-tun are DOWN - this is ok and they should not be put UP.ubuntu

3,查看CPU是否开启了虚拟化支持: 网络

grep -E 'svm|vmx' /proc/cpuinfo

若是有返回说明已经打开了,不然就没打开 app

4,# getconf LONG_BIT ssh

32 ui

(说明当前CPU运行在32bit模式下, 但不表明CPU不支持64bit)
this

# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
spa

8 code

(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)orm

5, 只有外部网络(external)才能分配浮动IP(In Quantum, a floating IP pool is represented as an external network and a floating IP is allocated from a subnet associated with the external network. )

6.  pu ic key,等都是在虚拟机建立时经过metadata服务得到的而注入到虚拟机之中的;ip地址则是建立或每次重启时得到的。若是拿不到IP地址,或建立虚拟机后没法ssh,则全与metadata服务有关 

7.将raw格式的镜像转换成qcow2的镜像:

qemu-img convert -f raw -O qcow2 ./ubuntu.img ./ubuntu.qcow2

8.不少时候发现nova-compute挂掉,或者不正常了,经过nova-manage查看状态是XXX了。 
每每是nova-compute的主机时间和controller的主机时间不一致。 nova-compute是定时地往数据库中services这个表update时间的,这个时间是nova-compute的主机时间。 
       controller校验nova-compute的存活性是以controller的时间减去nova-compute的update时间,若是大于多少秒(具体数值代码里面有,好像是15秒?)就判断nova-compute异常。 
       这个时候你用nova-manage查看nova-compute状态是XXX,若是建立虚拟机,查看nova-scheduler.log 就是提示找不到有效的host 其余服务节点类同,这是nova心跳机制问题。因此讲nova环境中各节点时间同步很重要。必定要确保时间同步!! 
有的弟兄在dashboard上看nova-compute状态,可能一下子变红,一下子变绿。那就严格同步时间,或者找到代码,把上面的那个15秒改大一点。 

9, When you request a volume be attached to /dev/vdX what actually happens on all host Hypervisors except Xen is that the device is assigned to the next available letter in the guest - effectively the auto-assignment logic is always in effect.

What this means is practice is if your guest has a /dev/vda device already, and you request /dev/vdc, the device will actually be assigned to /dev/vdb in spite of your request. 

10,Database

requests for the OpenStack Compute service are proxied through the nova-conductor

service.

11,# quantum subnet-create --name ext_subnet1 --allocation-pool start=  10.10.10.2 ,end= 10.10.10.100  --gateway  10.10.10.1 ext_net   10.10.10.0/24 --enable_dhcp=False