设为首页 收藏本站
查看: 1274|回复: 0

[经验分享] Openstack: Single node Installation and External Network Accessing Configuration

[复制链接]

尚未签到

发表于 2017-6-27 10:18:44 | 显示全部楼层 |阅读模式
Summary of installation


  Step 0: Prerequisites
  Step 1: Create Openstack hostsystem
  Step 2: Config
Openstack host
system
  Step 3: Install Openstackplatform
  Step 4: Login Openstack
  Step 5: Config to access external network
  



Step 0: Prerequisites


  
  Software


·Red Hat Enterprise Linux (RHEL) 7is preferred. (e.g.CentOS-7-x86_64-Minimal-1611.iso, or the equivalent version of one of theRHEL-based Linux distributions such as CentOS, Scientific Linux, and so on. )

·x86_64 is currently the only supported architecture.

·VirtualBox 5.0.30  
  Hardware


·Machine: PC / Mac

·RAM: 6+GB

·Processors: 2 ~4(with hardware virtualization extensions)

·Network Adapter: 1+ (Cable MUST be connected to yourcomputer if usingMac system.)


Step 1: Create Openstack host system
DSC0000.jpg


      Make sure RAM size is bigger than 6GB
DSC0001.jpg


DSC0002.jpg

  


     VDI is preferred.
DSC0003.jpg


      Dynamically Allocation ispreferred.

DSC0004.jpg       Make sure Disk Size is greater than60GB.

DSC0005.jpg
      2 ~ 4 processor is preferred.
   DSC0006.jpg


  
      Make sure following:


  • Only one Adapter is needed.
  • Adapter Type is “Bridge”.
  • Promiscuous Mode is “Allow All”.
  • Cable Connected is checked.

DSC0007.jpg       Make sure following:




  • Load CentOS installation image to the driver.

DSC0008.jpg

  • Launch virtual instance we created just now.
  • Install CentOS to the instance.
  • Most of configuration could be proceed by clicking “Next” button with one exception that Ethernet Card Connection needs to be turn on in manually.

DSC0009.jpg
Step 2: Config OpenStack host system


  • Reboot virtual instance after installation
  • Log into instance with the correct credential info, such as root/root
  • vi /etc/environment  

    LANG=en_US.utf-8
    LC_ALL=en_US.utf-8
  • source /etc/environment
  • Turn off firewall:


systemctl disable firewalld
systemctl stop firewalld

        (Note: Ignore the error message, such as “Failed to execute operation: Access denied”)

Step 3: Install Openstack platform


  •   yum install -y centos-release-openstack-newton
  •   yum update–y
  •   yum install -y openstack-packstack
  •   vi ~/.bash_profile

    export LANG="en_US.UTF-8”
    export LC_COLLATE="en_US.UTF-8”
    export LC_CTYPE="en_US.UTF-8”
    export LC_MESSAGES="en_US.UTF-8”
    export LC_MONETARY="en_US.UTF-8”
    export LC_NUMERIC="en_US.UTF-8”
    export LC_TIME="en_US.UTF-8”
    export LC_ALL="en_US.UTF-8”
  • packstack --allinone--provision-demo=n --os-neutron-ovs-bridge-mappings=extnet:br-ex--os-neutron-ovs-bridge-interfaces=br-ex:eth0--os-neutron-ml2-type-drivers=vxlan,flat,vlan
      Note:


  • Ensure “flat” and “vlan” have been added into ml2-type-drivers list.
  • Ensure eth0 is not your current network card which is using for yourssh connection.
DSC00010.jpg


Step 4: Login Openstack


  • cat keystonerc_admin  

    unset OS_SERVICE_TOKEN
    export OS_USERNAME=admin
    export OS_PASSWORD=98a76dc776654792
    exportOS_AUTH_URL=http://10.140.253.44:5000/v2.0
    export PS1='[\u@\h \W(keystone_admin)]\$'
    exportOS_TENANT_NAME=admin
    exportOS_REGION_NAME=RegionOne

  • Log into openstack dashboard viahttp://10.140.253.XXX/dashboard (admin/98a76dc776654792)
  • Start your openstackjourney.

Step 5: Config to access external network







5.1 Create Bridge


  • vi /etc/sysconfig/network-scripts/ifcfg-br-exDEVICE=br-ex
    DEVICETYPE=ovs
    TYPE=OVSBridge
    BOOTPROTO=static
    IPADDR=10.140.253.XXX# Old eth0 IP since we want the network restart to not   
    # kill the connection, otherwise pick something outside your dhcprange
    NETMASK=255.255.255.0  # your netmask
    GATEWAY=10.140.253.1 #yourgateway
    DNS1=123.123.123.XXX     #yournameserver
    ONBOOT=yes
  • vi /etc/sysconfig/network-scripts/ifcfg-ethXXXDEVICE=ethXXX
    TYPE=OVSPort
    DEVICETYPE=ovs
    OVS_BRIDGE=br-ex
    ONBOOT=yes
  • service network restart



5.2 Create External Network


  •   Log into dashboard via http://10.140.253.XXX/dashboard withyour credential.
  •   Go to Admin->System->Networks
  •   Create a network with following info:
  •   Name:external_network
  •   Project:admin
  •   Provider Network Type: Flat
  •   Physical Network: extnet
  •   Segment ID: <any number>
  •   Admin State: UP
  •   Shared:checked
  •   External Network: checked

5.3 Create Subnet of External Network




  • Subnet Name: <any string>
  • Network Address: <any available range> e.g.10.140.253.100/28
  • IP Version: IPv4
  • Gateway IP: <same with your host gateway> e.g.
    10.140.253.1

DSC00011.jpg


  • Uncheck DHCP
  • Allocation Pools: <any avaliable range within your Network(10.140.253.100/28>
  • DNS Name Servers: <your host DNS servers> e.g.123.123.123.123 , 8.8.8.8
DSC00012.jpg



5.4 Create Internal Network


  • Name: private_network
  • Project: admin
  • Provider Network Type: VXLAN
  • Physical Network: extnet
  • Segment ID: <any number>.
  • Admin State: UP
  • Shared: checked
  • External Network: unchecked
DSC00013.jpg



5.5 Create Subnet of Internal Network


  • Subnet Name: <any string>
  • Network Address: <any available range> e.g.192.168.100.0/24
  • IP Version: IPv4
DSC00014.jpg




  • Uncheck DHCP
  • Allocation Pools: <any available range within your Network(192.168.100.0/24>
  • DNS Name Servers: <your host DNS servers> e.g.123.123.123.123, 8.8.8.8
DSC00015.jpg


5.6 Create Router
DSC00016.jpg



  • Router Name: <Any string>
  • Admin State: UP
  • External Network: external_network
DSC00017.jpg



5.7 Associate Networks




  • Go back to Network Topology
  • Click “Add Interface”
DSC00018.jpg




  • IP Address: <gateway server ip of the internal network> e.g.192.168.100.1
DSC00019.jpg


5.8 Config Security Policy


  • Go to Project -> Compute -> Access & Security
  • Click“Manage Rules” button on “default” item.
DSC00020.jpg



  • Remove all default rules.
  • Recreate rules for protocals“ICMP”, “TCP” and “UDP” with both Ingress and Egress directions.
DSC00021.jpg


5.9 Create Instance




  • Go back to Network Topology, you should see the external network and the private network are connected with a router
  • Click“Launch Instance” button to create an vm
DSC00022.jpg




  • Instance Name: <any string>
  • Availability Zone: nova
  • Count:1
DSC00023.jpg



  • Boot Source: Image
  • Volume Size: <The min size of your image>
  • Create New Volume: YES
  • Delete Volume on Instance Delete:YES
  • Allocated:<Your image> e.g. cirros
DSC00024.jpg

          Choose appropriate flavor size.
          e.g m1.tiny

DSC00025.jpg
          Choose the network you want to create an instance on.
          e.g. “private_network”

DSC00026.jpg
          Choose the key pair which you want to used for logging into the instance later on.

DSC00027.jpg
          Click “Launch Instance” to start instance.

DSC00028.jpg
          Once the instance is created successfully, you should see the Power State is changed to “Running”.

DSC00029.jpg   

5.10 Allocate Floating IP




  • Click the instance drop-down list
  • Click Associate Floating IP
DSC00030.jpg



  • Click”+” button to creating an floating IP address in a specific Network.
  • If it’s already done, you can also choose an
    avaliable IP address from the drop-down list.
DSC00031.jpg



  • Choose the network you want to create an IP address on. (e.g. “External_network”)
  • Click “Allocate IP”
DSC00032.jpg



  • Choose the IP address we created just now.
  • Click “Associate” button
DSC00033.jpg

          Now, you should see 2 IP address havebeen associated with the instance.
          One is for
private_network;another one (Floating IP) is forexternal_network.

DSC00034.jpg

5.11 Instance Login




  • Click the Instance name and switch to “Console” tab. You could log into the instance.
  • Type your credential info to login. e.g.cirros/cubswin:)
DSC00035.jpg


5.12 IP Binding
          If you check the network information, you would find that there is no any IPv4 address bind to the instance.


          Neither192.168.100.11, nor 10.140.253.100



DSC00036.jpg           Execute following 2 commands:





sudo ifconfig eth0 192.168.100.11 netmask 255.255.255.0
sudo route add default gw 192.168.100.1

DSC00037.jpg



         Now, the private IP address has been associated with the instance.
          (We do not need to bind the public IP 10.140.253.100 here, because the HTTP requests will be transferred to the outside world by the router which is connected “private_network”and “external_network”.
          More importantly, that is why10.140.253.100 is an floating IP, and how does it work.)

DSC00038.jpg
         Ping 8.8.8.8 is OK.

DSC00039.jpg           However, Ping by domain name is not working.
          e.g. ping www.google.com
  
          sudo vi /etc/resolv.conf

  

nameserver 123.123.123.123
nameserver 8.8.8.8


DSC00040.jpg
  
  Ping www.google.comis OK.

DSC00041.jpg   


  Ping the instance from ”external_network” is pass as well.

DSC00042.jpg
DSC00043.jpg






6 Useful Tools
  # show current network info

ip a
  


  # show current gateway info

route
netstat -rn
  


  # show current network namespace

ipnet ns list
  e.g. qrouter-bc826659-8f64-4f82-8f20-8fb76e3c5d9d
  


  #execute command via specific network

ipnet ns exec qrouter-bc826659-8f64-4f82-8f20-8fb76e3c5d9d ping www.google.com
  #bind specific ip to network interface

ifconfig eth0 192.168.100.11 netmask 255.255.255.0
  #add default gateway route

route add default gw 192.168.100.1

Reference:
  http://www.learnlinux.org.za/courses/build/net-admin/ch01s11.html
  https://www.rdoproject.org/install/quickstart/

https://www.rdoproject.org/networking/neutron-with-existing-external-networ

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-388519-1-1.html 上篇帖子: OpenStack网络指导手册 -基本网络概念 下篇帖子: how to read openstack code: Core plugin and resource extension
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表