【OpenStack】OpenStack系列9之Compute节点安装

  1. 安装
    1. 安装参考:

      https://github.com/yongluo2013/osf-openstack-training/blob/master/installation/openstack-icehouse-for-centos65.md

    2. 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

    创建外部网络、为外部网络添加子网

    创建租户、租户网络、租户网络子网

    为租户网络创建路由连接到外部子网

     

     

    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

  2. Nova-network——FlatDHCP模式
    1. 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

    2. nova-manage floating create --ip_range=172.16.0.0/24 --pool=public

      nova-manage floating list

    3. 添加安全组规则,即可使用浮动IP访问虚拟机。

      iptables -t nat –L

      查看DNAT、SNAT规则。

    4. 磁盘挂载:

      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

    5. 网桥-不带vlan标签

    6. 命令行启动:

      nova boot vm01-test --availability-zone nova --flavor 1 --image cirros-0.3.0-x86_64 --nic net-id=4227cf77-e56f-43aa-aa4b-23d05254cc79

    7. Vnc连接不上:所有进程均正常,重启nova-compute、nova-network、nova-novncproxy进程解决。
  3. Nova-network——VLAN模式
    1. 需要加载:modprobe 8021q
    2. nova-manage network create private-vlan-100 --project_id="3edbf8dbb5234ac29831d608aa824c7e" --fixed_range_v4=192.168.4.0/24 --vlan=100 --multi_host=T

    3. 虚拟机网卡:

    4. 服务器重启后实例的恢复问题

      http://blog.csdn.net/ugyn109/article/details/7610882

    5. Bridge+Vlan:

      http://net.doit.wisc.edu/~dwcarder/captivator/linux_trunking_bridging.txt

    6. 删除关联tenant的网络:nova-manage account scrub --project 3edbf8dbb5234ac29831d608aa824c7e

      nova-manage network delete --uuid=72fe9d5b-fbc9-492d-9bef-4e204b3c8375

      或者:

    7. yum install vconfig –y
    8. 虚拟机创建完毕:

    9. 同一网段虚拟机可以相互ping通,不同网段如果没有网关交换机,则通过fixed_ip默认不通。
  4. Neutron——gre模式
    1. type_drivers = local,flat,vlan,gre,vxlan
    2. neutron-l3-agent启动失败问题:neutron-l3-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini &
    3. neutron router-list

    4. ip netns

    5. neutron net-list

    6. neutron router-port-list router-gre

    7. ip netns exec qrouter-9f83b823-7b8f-4340-afc1-fe2f004fb7f6 ifconfig

    8. ip netns exec qrouter-9f83b823-7b8f-4340-afc1-fe2f004fb7f6 route –n

    9. neutron port-list –D

    10.  
原文地址:https://www.cnblogs.com/junneyang/p/5257274.html