DevStack Quick Start 官方文档

启动一个实例操作文档-中文

启动一个实例操作文档-英文

DevStack 一键安装,看起来很美!也许是咱国内网络环境受限造成各种不适,官方文档说大概 15 -20 分钟完成?半天功夫能完成就算运气好!

既然是学习 OpenStack ,各种麻烦都是必须克服的!

我的环境

 虚拟机 2 CPU , 16 G RAM网卡 eth0: 192.168.0.121网卡 eth1: 不设 IPUbuntu 20.04

安装过程

  1. 提前准备一下环境 (hostname、github 镜像)
    $ cat /etc/hosts

     127.0.0.1 localhost127.0.1.1 ubuntu2004-121# The following lines are desirable for IPv6 capable hosts::1     ip6-localhost ip6-loopbackfe00::0 ip6-localnetff00::0 ip6-mcastprefixff02::1 ip6-allnodesff02::2 ip6-allrouters192.168.0.121 ubuntu2004-121140.82.113.3 github.com
    
  2. 按照 [DevStack Quick Start 官方文档 ] (https://docs.openstack.org/devstack/latest/) 操作

    $ sudo useradd -s /bin/bash -d /opt/stack -m stack
    $ sudo chmod +x /opt/stack
    $ echo “stack ALL=(ALL) NOPASSWD: ALL” | sudo tee /etc/sudoers.d/stack
    $ sudo -u stack -i
    $ git clone https://opendev.org/openstack/devstack
    $ cd devstack

  3. 准备配置文件 local.conf
    开头必须是 [[local|localrc]] (注释行除外)
    刚开始学习时最好配置最小化,其余都缺省
    以下多余的行我都注释掉了,那都是折腾过程的足迹

    $ cat local.conf

     [[local|localrc]]ADMIN_PASSWORD=passwordDATABASE_PASSWORD=$ADMIN_PASSWORDRABBIT_PASSWORD=$ADMIN_PASSWORDSERVICE_PASSWORD=$ADMIN_PASSWORD## PUBLIC_INTERFACE=eth1# HOST_IP=192.168.0.121# FLOATING_RANGE=192.168.0.0/24# PUBLIC_NETWORK_GATEWAY=192.168.0.81# Q_FLOATING_ALLOCATION_POOL=start=192.168.0.10,end=192.168.0.30## FLOATING_RANGE=192.168.0.10/28# FIXED_RANGE=10.11.12.0/24## use TryStack git mirrorGIT_BASE=http://git.trystack.cnNOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.gitSPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git
    
  4. 开始安装
    $ ./stack.sh
    千万别着急!隔十分钟过来看一眼,发现各种红色的错误,重新执行 ./stack.sh
    不是红色的错误的话,也需要看看错误提示,然后重新执行 ./stack.sh

    晚八点左右不要干活,网速不好,会不断 Error ,不断继续!考验你的耐心!

    最后正确完成大概是这样子

     +functions-common:service_check:1722       sudo systemctl status devstack@dstat.service --no-pager● devstack@dstat.service - Devstack devstack@dstat.serviceLoaded: loaded (/etc/systemd/system/devstack@dstat.service; enabled; vendor preset: enabled)Active: inactive (dead) since Sat 2022-10-29 09:27:38 CST; 20min agoMain PID: 395881 (code=exited, status=0/SUCCESS)Oct 29 09:27:38 ubuntu2004-121 dstat.sh[396169]:   --color               force colorsOct 29 09:27:38 ubuntu2004-121 dstat.sh[396169]:   --nocolor             disable colorsOct 29 09:27:38 ubuntu2004-121 dstat.sh[396169]:   --noheaders           disable repetitive headersOct 29 09:27:38 ubuntu2004-121 dstat.sh[396169]:   --noupdate            disable intermediate headersOct 29 09:27:38 ubuntu2004-121 dstat.sh[396169]:   -o file, --output=fileOct 29 09:27:38 ubuntu2004-121 dstat.sh[396169]:                         write CSV output to fileOct 29 09:27:38 ubuntu2004-121 dstat.sh[396169]:   --profile             show profiling statistics when exiting dstatOct 29 09:27:38 ubuntu2004-121 dstat.sh[396169]: delay is the delay in seconds between each update (default: 1)Oct 29 09:27:38 ubuntu2004-121 dstat.sh[396169]: count is the number of updates to display before exiting (default: unlimited)Oct 29 09:27:38 ubuntu2004-121 systemd[1]: devstack@dstat.service: Succeeded.+functions-common:service_check:1          exit_trap+./stack.sh:exit_trap:516                  local r=3++./stack.sh:exit_trap:517                  jobs -p+./stack.sh:exit_trap:517                  jobs=393564+./stack.sh:exit_trap:520                  [[ -n 393564 ]]+./stack.sh:exit_trap:520                  [[ -n '' ]]+./stack.sh:exit_trap:526                  '[' -f /tmp/tmp.I3IZErxZsR ']'+./stack.sh:exit_trap:527                  rm /tmp/tmp.I3IZErxZsR+./stack.sh:exit_trap:531                  kill_spinner+./stack.sh:kill_spinner:426               '[' '!' -z '' ']'+./stack.sh:exit_trap:533                  [[ 3 -ne 0 ]]+./stack.sh:exit_trap:534                  echo 'Error on exit'Error on exit+./stack.sh:exit_trap:536                  type -p generate-subunit+./stack.sh:exit_trap:537                  generate-subunit 1667004651 3457 fail+./stack.sh:exit_trap:539                  [[ -z /opt/stack/logs ]]+./stack.sh:exit_trap:542                  /usr/bin/python3.8 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logsWorld dumping... see /opt/stack/logs/worlddump-2022-10-29-014829.txt for details+./stack.sh:exit_trap:551                  exit 3
    

快照

保存一份快照!
保存一份快照!
保存一份快照!

错误处理

  1. ERROR: Could not find a version that satisfies the requirement attrs=22.1.0 (from -c /opt/stack/requirements/upper-constraints.txt (line 48)) (from versions: none)
    ERROR: No matching distribution found for attrs=22.1.0 (from -c /opt/stack/requirements/upper-constraints.txt (line 48))

    这种版本错误遇到次数最多!
    我更换过清华和阿里的pip源,错误次数更多,而且还解决不了
    后来,还是去掉了国内源,才最后安装完成

    解决方法:
    $ pip install attrs

     Requirement already satisfied: attrs in /usr/lib/python3/dist-packages (19.3.0)stack@ubuntu2004-121:~/devstack$ pip install attrs===22.1.0Collecting attrs===22.1.0Downloading attrs-22.1.0-py2.py3-none-any.whl (58 kB)|████████████████████████████████| 58 kB 192 kB/s Installing collected packages: attrsSuccessfully installed attrs-22.1.0
    
  2. E: Could not get lock /var/lib/dpkg/lock. It is held by process 2019 (unattended-upgr)
    N: Be aware that removing the lock file is not a solution and may break your system.
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

    解决方法:
    一般直接 sudo rm /var/lib/dpkg/lock 然后 sudo apt update 就可以,但是,经常 rm 了也不行

    $ sudo dpkg --configure -a

     dpkg: error: dpkg database lock is locked by another process
    

    $ sudo lsof /var/cache/apt/archives/lock

     COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF    NODE NAMEunattende 6583 root   97uW  REG  253,0        0 5374143 /var/cache/apt/archives/lock
    

    $ sudo rm /var/cache/apt/archives/lock

    继续之前,可以再次 sudo apt update

  3. libsystemd-dev : Depends: libsystemd0 (= 245.4-4ubuntu3.18) but 245.4-4ubuntu3.19 is to be installed
    E: Unable to correct problems, you have held broken packages.
    +functions-common:apt_get:1 exit_trap

    解决方法:

    $ sudo apt install aptitude

    $ sudo aptitude install libsystemd-dev
    The following NEW packages will be installed:
    libsystemd-dev{b}
    The following packages will be REMOVED:
    libfwupdplugin1{u} libxmlb1{u}
    0 packages upgraded, 1 newly installed, 2 to remove and 9 not upgraded.
    Need to get 246 kB of archives. After unpacking 356 kB will be used.
    The following packages have unmet dependencies:
    libsystemd-dev : Depends: libsystemd0 (= 245.4-4ubuntu3.18) but 245.4-4ubuntu3.19 is installed
    The following actions will resolve these dependencies:

     Keep the following packages at their current version:
    
    1. libsystemd-dev [Not Installed]
      

    Accept this solution? [Y/n/q/?] n
    The following actions will resolve these dependencies:

    注意这里不要习惯性的输入 Y ,而是输入 N ,因为这个是 Not Installed

  4. ERROR: Could not find a version that satisfies the requirement sqlalchemy (from versions: none)
    ERROR: No matching distribution found for sqlalchemy

    这个错误和前面错误1 一样,但是,当时我没能跨过去,当时分别使用清华和阿里的pip源,都没能搞定!
    最后,还是去掉 pip 国内源,安装过程也不再报这个错误了!

  5. 错误: 实例 “vm-2” 执行所请求操作失败,实例处于错误状态。: 请稍后再试 [错误: Host ‘ubuntu2004-121’ is not mapped to any cell].

    在 dashboard 上创建实例总是失败
    解决方法:

    $ nova-manage cell_v2 discover_hosts --verbose

     Modules with known eventlet monkey patching issues were imported prior to eventlet monkey patching: urllib3. This warning can usually be ignored if the caller is only importing and not executing nova code./usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes insteadfrom cryptography.utils import int_from_bytes/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes insteadfrom cryptography.utils import int_from_bytesINFO dbcounter [None req-cb97580d-01ba-4737-9cb0-0247209a7f58 None None] Registered counter for database nova_apiDEBUG dbcounter [-] [351166] Writer thread running {{(pid=351166) stat_writer /usr/local/lib/python3.8/dist-packages/dbcounter.py:99}}Found 2 cell mappings.Skipping cell0 since it does not contain hosts.Getting computes from cell 'cell1': 8a767d7e-5999-4b58-9420-87cc3b86e463INFO dbcounter [None req-cb97580d-01ba-4737-9cb0-0247209a7f58 None None] Registered counter for database nova_cell1DEBUG dbcounter [-] [351166] Writer thread running {{(pid=351166) stat_writer /usr/local/lib/python3.8/dist-packages/dbcounter.py:99}}Checking host mapping for compute host 'ubuntu2004-121': d73e1fd2-dfd9-4ba1-bc2a-a3df8a85cfa8Creating host mapping for compute host 'ubuntu2004-121': d73e1fd2-dfd9-4ba1-bc2a-a3df8a85cfa8Found 1 unmapped computes in cell: 8a767d7e-5999-4b58-9420-87cc3b86e463
    

    可以看到最后 : Found 1 unmapped computes in cell: 8a767d7e-5999-4b58-9420-87cc3b86e463

创建虚拟机实例

  1. 如果在 CLI 方式下
    ~/devstack$ source openrc admin admin

    注意这里参数有 2 个 admin ,第二个表示项目名

    生成一个键值对还是在命令行执行比较好,直接按照生成一个键值对

     $ ssh-keygen -q -N ""$ openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey
    

    安全规则也可以命令行完成

     $ openstack security group rule create --proto icmp default   $ openstack security group rule create --proto tcp --dst-port 22 default
    
  2. dashboard 下继续
    过程 (略)
    结果如下:

  3. 测试一下

    路由器 ip
    $ ping 172.24.4.145

    vm-1 :
    $ ping 172.24.4.123

    $ ssh cirros@172.24.4.123
    没有创建并上传键值对时, ssh 需要输入密码

    vm-2:
    $ ping 172.24.4.20

    $ ssh cirros@172.24.4.20
    创建并上传键值对后, ssh 不再需要输入密码

后记

是否需要调整外网地址(172.24.4.0/24)?

  1. 安装时没有设置 FLOATING_RANGE PUBLIC_INTERFACE=eth1 和 FLOATING_RANGE=192.168.0.0/24 ,所以,devstack 设置的外网地址是172.24.4.0/24
  2. devstack 并不会用于实际部署,所以,改成多少地址,没有什么意义

ubuntu20.04 安装 DevStack相关推荐

  1. 优麒麟Ubuntu20.04安装各种问题

    优麒麟Ubuntu用了六年了,版本旧了,所以按照20.04版. 1.adobe-flashplugin的安装极其慢 慎重啊!需要好几个小时,无法忍受啊! 2.dpkg被中断的解决方法 关闭掉Ubunt ...

  2. ubuntu20.04 安装 Qt5.12步骤

    转载链接:ubuntu20.04 安装 Qt5.12_仙海寻波的博客-CSDN博客_ubuntu20.04安装qt第一步 下载 Qt5.12.9安装包使用清华镜像进行下载:https://mirror ...

  3. 了解Docker、Ubuntu20.04安装docker教程

    Docker 的前世今生 https://my.oschina.net/u/4126211/blog/4517028 Ubuntu20.04安装docker教程 https://blog.csdn.n ...

  4. ubuntu20.04安装ROS及常见问题

    ubuntu20.04安装ROS及常见问题 一.ubuntu安装参考(双系统) 1.ios镜像官网下载地址: https://releases.ubuntu.com/?_ga=2.239339907. ...

  5. Ubuntu20.04安装,并Linux微信等

    Ubuntu20.04安装,并Linux微信等 一.Ubuntu20.04双硬盘双系统安装 电脑状况:256G+260G双固态硬盘,其中256G(sda)分C.D盘安装win10,460G(sdb)硬 ...

  6. ubuntu20.04安装小鹤双拼输入法挂接音形改简体中文Rime

    ubuntu20.04安装小鹤双拼输入法挂接音形改简体中文Rime 方案1,按照这个挂接方法,原始的繁体等其他的也还在: 替换方案 方案2 修改成默认简体中文: 更改皮肤 设置-区域与语言-改成中文- ...

  7. 微星主板 Ubuntu20.04安装以及配置

    1 设置U盘启动 1)插入使用软碟通制作好的U盘,开机按del键进入BIOS: 2)Boot Option 中 选择U盘启动: 3)设置硬盘BBS(我也不知道是什么): 4)点击左边Settings, ...

  8. Ubuntu20.04安装NVIDIA显卡驱动、CUDA、CUDNN及突破NVENC并发限制

    1.查看当前系统版本 cat /proc/version 显示为: 2.查看当前显卡型号: sudo lshw -numeric  -C display 显示我的显卡型号为:GM107M[GeForc ...

  9. Ubuntu20.04安装yum

    Ubuntu20.04安装yum 1打开终端,备份你原来Ubuntu默认的源地址 sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup ...

最新文章

  1. 三次握手,四次挥手?
  2. SQL语言之索引(Oracle)
  3. Android 插件化原理解析——Service的插件化
  4. Java字符串编码和转换操作
  5. php留言板记录ip,如何用php程序记录来访IP
  6. 从Hadoop到云原生,谈如何消除程序员35岁危机
  7. 马拉车(manacher)算法——最长回文(hdu3068)
  8. PHP教程 数据库和MySQL_PHP教程 - MySQL 创建数据库和表
  9. 物联网时代,安全该如何加固?
  10. symfony3 yml配置文件详解
  11. cube云原生机器学习平台-架构(五)
  12. windows7下修改hosts文件无效解决办法(转)
  13. 三维旋转矩阵_线性代数的本质(4)--矩阵乘法与复合变换
  14. Python django model 插入新增一条数据,得到create返回主键值 id
  15. tmux使用(程序员适用)
  16. 论文降重的技巧(一顿操作猛如虎-一看查重35%)
  17. #9733;如何解释特修斯之船问题?
  18. b365老掉线 h3c路由器_H3C路由器频繁断线的原因及解决方法
  19. Hibernate 的 could not initialize proxy - the owning Session was closed问题
  20. .Dragon4444勒索病毒处理成功方法

热门文章

  1. 王者皮肤抽奖名称英雄语音播报流量主小程序开发
  2. 我的世界java手机_我的世界java1.16手机版
  3. java职工工资管理系统(GUI+无数据库)
  4. 初次和男友家长见面一定要懂的礼貌!(建议女孩子都看看)
  5. mybatis中的parameterType属性
  6. JPA查询单个字段和多个字段返回类型总结
  7. 永恒之塔修改服务器名字,永恒之塔模拟器服务端每个文件的用途及修改
  8. 对数据库增删查、 utf8_genera_ci、 utf8_general_cs模式含义
  9. 2021.03.23课堂笔记
  10. MySQL-SQL结构化查询语言