水很深
前几天测试了一下devstack的安装,一切按照默认最简的方式进行,虽然最后也成功启动了,但是关键的Network一项竟然没有包含,这次重新来过,改用Ubuntu 14.04 Minimal CD安装系统,为了兼容公司和家里两个不同的网络环境,改用VirtualBox的Net Network模式来分配IP地址,如下配置VirtualBox的Net Network设置:
将Network CIDR修改为家里的无线网地址段,这样虚拟机拷回去之后就可以改成Bridge方式直接访问了,也不用做任何修改(后来证实这个做法不可行,移动之后的VirtualBox虚拟机,无法和外部通信,虽然可以DHCP获取到地址,但是却ping不通网关,不知道是不是openstack的配置在影响?)。为了在公司内使用,还需再做两个端口映射,访问ssh和dashboard:
这样配置好之后,将虚拟机内IP改为静态分配,修改/etc/network/interfaces:
# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.110
netmask 255.255.255.0
gateway 192.168.1.1
还要配两DNS服务器,否则不能解析地址,修改/etc/resolvconf/resolv.conf.d/base,添加:
nameserver 114.114.114.114
nameserver 180.76.76.76
nameserver 8.8.8.8
接下来是devstack的配置文件local.conf,参考陈沙克的文章(作者牛人,链接戳此处)修改如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
[[local|localrc]] # Define images to be automatically downloaded during the DevStack built process. IMAGE_URLS="http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img" #change github to trystack #GIT_BASE=${GIT_BASE:-http://git.trystack.cn} #NOVNC_REPO=${NOVNC_REPO:-http://git.trystack.cn/kanaka/noVNC.git} # Credentials DATABASE_PASSWORD=pass ADMIN_PASSWORD=pass SERVICE_PASSWORD=pass SERVICE_TOKEN=pass RABBIT_PASSWORD=pass #FLAT_INTERFACE=eth0 HOST_IP=192.168.1.110 SERVICE_HOST=192.168.1.110 MYSQL_HOST=192.168.1.110 RABBIT_HOST=192.168.1.110 GLANCE_HOSTPORT=192.168.1.110:9292 ## Neutron options Q_USE_SECGROUP=True FLOATING_RANGE="192.168.1.0/24" FIXED_RANGE="10.0.0.0/24" Q_FLOATING_ALLOCATION_POOL=start=192.168.1.120,end=192.168.1.130 PUBLIC_NETWORK_GATEWAY="192.168.1.1" Q_L3_ENABLED=True PUBLIC_INTERFACE=eth0 Q_USE_PROVIDERNET_FOR_PUBLIC=True OVS_PHYSICAL_BRIDGE=br-ex PUBLIC_BRIDGE=br-ex OVS_BRIDGE_MAPPINGS=public:br-ex # Work offline #OFFLINE=True # Reclone each time RECLONE=yes # Branches Now the devstack have bug in keystone and neutron for liberty. so we need use master #KEYSTONE_BRANCH=stable/liberty #NOVA_BRANCH=stable/liberty #NEUTRON_BRANCH=stable/liberty #SWIFT_BRANCH=stable/liberty #GLANCE_BRANCH=stable/liberty #CINDER_BRANCH=stable/liberty #HEAT_BRANCH=stable/liberty #TROVE_BRANCH=stable/liberty #HORIZON_BRANCH=stable/liberty #SAHARA_BRANCH=stable/liberty #CEILOMETER_BRANCH=stable/liberty # Logging # ------- # By default ``stack.sh`` output only goes to the terminal where it runs. It can # be configured to additionally log to a file by setting ``LOGFILE`` to the full # path of the destination log file. A timestamp will be appended to the given name. LOGFILE=/opt/stack/logs/stack.sh.log VERBOSE=True LOG_COLOR=True SCREEN_LOGDIR=/opt/stack/logs # the number of days by setting ``LOGDAYS``. LOGDAYS=1 # Database Backend MySQL enable_service mysql # RPC Backend RabbitMQ enable_service rabbit # Enable Keystone - OpenStack Identity Service enable_service key # Horizon - OpenStack Dashboard Service enable_service horizon # Enable Swift - Object Storage Service without replication. enable_service s-proxy s-object s-container s-account SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5 SWIFT_REPLICAS=1 # Enable Glance - OpenStack Image service enable_service g-api g-reg # Enable Cinder - Block Storage service for OpenStack #VOLUME_GROUP="cinder-volumes" enable_service cinder c-api c-vol c-sch c-bak # Enable Heat (orchestration) Service #enable_service heat h-api h-api-cfn h-api-cw h-eng # Enable Trove (database) Service enable_service trove tr-api tr-tmgr tr-cond # Enable Sahara (data_processing) Service #enable_service sahara # Enable Tempest - The OpenStack Integration Test Suite enable_service tempest # Enabling Neutron (network) Service disable_service n-net enable_service q-svc enable_service q-agt enable_service q-dhcp enable_service q-l3 enable_service q-meta enable_service q-metering enable_service neutron ## Neutron - Load Balancing #enable_service q-lbaas ## Neutron - Firewall as a Service #enable_service q-fwaas ## Neutron - VPN as a Service #enable_service q-vpn # VLAN configuration. Q_PLUGIN=ml2 ENABLE_TENANT_VLANS=True # GRE tunnel configuration #Q_PLUGIN=ml2 #ENABLE_TENANT_TUNNELS=True # VXLAN tunnel configuration #Q_PLUGIN=ml2 #Q_ML2_TENANT_NETWORK_TYPE=vxlan # Enable Ceilometer - Metering Service (metering + alarming) enable_service ceilometer-acompute ceilometer-acentral ceilometer-collector ceilometer-api enable_service ceilometer-alarm-notify ceilometer-alarm-eval enable_service ceilometer-anotification ## Enable NoVNC enable_service n-novnc [[post-config|$NOVA_CONF]] [DEFAULT] # Ceilometer notification driver instance_usage_audit=True instance_usage_audit_period=hour notify_on_state_change=vm_and_task_state notification_driver=nova.openstack.common.notifier.rpc_notifier notification_driver=ceilometer.compute.nova_notifier |
安装正常步骤开始安装,如果遇到错误,可以先运行clean.sh删除掉以前的环境重新开始。这次安装后,如愿看到了NetWork选项:
还有网络拓扑图:
初次接触,OpenStack太过强大,内容很多不是业余选手一时半会可以吸收的,还是读读手册吧,找到一本OpenStack Cloud Computing Cookbook - Third Edition True PDF(链接: magnet:?xt=urn:btih:889266F86FC59E9B725002953603B6359A35BED7),先粗览一下。