-
安装
-
安装参考:
-
Libvirt安装
yum install kvm qemu-kvm qemu-kvm-tools
yum install bridge-utils qemu-img
yum install python-virtinst virt-manager virt-viewer
yum install libvirt libvirt-client
reboot
lsmod | grep kvm
virsh version
/etc/init.d/libvirtd start
service libvirtd status
virsh list --all
virt-manager
nova-compute &
nova-manage service list
nova image-list
nova volume-list
nova network-list
nova list
neutron subnet-create ext-net 10.20.0.0/24 --name ext-subnet --allocation-pool start=10.20.0.100,end=10.20.0.200 --disable-dhcp --gateway 10.20.0.1
创建外部网络、为外部网络添加子网
创建租户、租户网络、租户网络子网
为租户网络创建路由连接到外部子网
-
问题:
需要指定compute_driver=nova.virt.libvirt.LibvirtDriver
https://bugs.launchpad.net/nova/+bug/1139684
https://www.rdoproject.org/forum/discussion/242/nova-conf-compute_driver-setting/p1
mkdir -p /usr/lib/python2.6/site-packages/instances
解决nova-compute启动报OSError: [Errno 2] No such file or directory: '/usr/lib/python2.6/site-packages/instances'问题
http://www.boyunjian.com/do/article/snapshot.do?uid=1496353779464189827
-
-
Nova-network——FlatDHCP模式
-
nova network-create private --fixed-range-v4=192.168.4.0/24 --bridge-interface=br100 --multi-host=T --allowed-start=192.168.4.100 --allowed-end=192.168.4.200
nova network-list
-
nova-manage floating create --ip_range=172.16.0.0/24 --pool=public
nova-manage floating list
-
添加安全组规则,即可使用浮动IP访问虚拟机。
iptables -t nat –L
查看DNAT、SNAT规则。
-
磁盘挂载:
http://www.fikker.com/bigcache2/help/linux-fdisk.html
http://www.cnblogs.com/nerxious/archive/2013/01/14/2859493.html
http://www.fikker.com/bigcache2/help/images/fstab-fikker-2.png
-
网桥-不带vlan标签
-
命令行启动:
nova boot vm01-test --availability-zone nova --flavor 1 --image cirros-0.3.0-x86_64 --nic net-id=4227cf77-e56f-43aa-aa4b-23d05254cc79
-
Vnc连接不上:所有进程均正常,重启nova-compute、nova-network、nova-novncproxy进程解决。
-
-
Nova-network——VLAN模式
-
需要加载:modprobe 8021q
-
nova-manage network create private-vlan-100 --project_id="3edbf8dbb5234ac29831d608aa824c7e" --fixed_range_v4=192.168.4.0/24 --vlan=100 --multi_host=T
-
虚拟机网卡:
-
服务器重启后实例的恢复问题
-
Bridge+Vlan:
http://net.doit.wisc.edu/~dwcarder/captivator/linux_trunking_bridging.txt
-
删除关联tenant的网络:nova-manage account scrub --project 3edbf8dbb5234ac29831d608aa824c7e
nova-manage network delete --uuid=72fe9d5b-fbc9-492d-9bef-4e204b3c8375
或者:
-
yum install vconfig –y
-
虚拟机创建完毕:
-
同一网段虚拟机可以相互ping通,不同网段如果没有网关交换机,则通过fixed_ip默认不通。
-
Neutron——gre模式
-
type_drivers = local,flat,vlan,gre,vxlan
-
neutron-l3-agent启动失败问题:neutron-l3-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini &
-
neutron router-list
-
ip netns
-
neutron net-list
-
neutron router-port-list router-gre
-
ip netns exec qrouter-9f83b823-7b8f-4340-afc1-fe2f004fb7f6 ifconfig
-
ip netns exec qrouter-9f83b823-7b8f-4340-afc1-fe2f004fb7f6 route –n
-
neutron port-list –D
-
-