# Ubutu
# DevStackとは?
READMEはここに。
https://opendev.org/openstack/devstack
https://openstack.jp/how_to_deploy
2021 3/6
# 今日はどこまでやる?
- Ubuntu(ubuntu Server 20.04 LTS)のクリーンインストール
- ユーザの作成
- KVM環境の構築
- VM立てて動くことを確認(sshが出来てるかとか)
- DevStack or OpenStackの勉強
- 18:00なったら解散
# Ubuntu Server 20.04 LTS インストール時の設定

eno2の設定
# トラブルシューティング
Ubuntuのインストール時にユーザ名とパスワードを忘れた。
https://tkzo.jp/blog/how-to-startup-ubuntu-with-recovery-mode/#i-2
の手順に従えばrootでログインできる。
# DevStackが汚したこと
- https://opendev.org/openstack/devstack/src/branch/master/stack.sh
# local.conf
```local.conf
[[local|localrc]]
ADMIN_PASSWORD=B1HQh9dp
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
```
# 操作ログ
```sh'
[reud@Brenda .ssh]$ ssh jk8
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-135-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Sat Mar 6 04:13:18 UTC 2021
System load: 0.04
Usage of /: 59.9% of 1.72TB
Memory usage: 10%
Swap usage: 0%
Processes: 982
Users logged in: 2
IP address for eno1: 133.25.196.24
IP address for eno3: 192.168.200.200
IP address for tun0: 10.8.0.1
IP address for docker0: 172.17.0.1
IP address for virbr0: 192.168.122.1
IP address for labnet-br: 192.168.200.2
IP address for br-innet: 10.0.100.1
* Introducing self-healing high availability clusters in MicroK8s.
Simple, hardened, Kubernetes for production, from RaspberryPi to DC.
https://microk8s.io/high-availability
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
150 packages can be updated.
1 update is a security update.
*** System restart required ***
Last login: Mon Feb 22 04:13:57 2021 from 133.25.196.25
reiji@jk8:~$ logout
Connection to labnet3.dpdk.ninja closed.
[reud@Brenda .ssh]$ ssh jk6
The authenticity of host 'labnet5.dpdk.ninja (133.25.196.26)' can't be established.
ECDSA key fingerprint is SHA256:eJwrzWPmjMW1iJwymzOVYqIuKlSmEWCvz6WmD21tzUk.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'labnet5.dpdk.ninja,133.25.196.26' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.8.0-43-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
0 updates can be installed immediately.
0 of these updates are security updates.
Your Hardware Enablement Stack (HWE) is supported until April 2025.
*** System restart required ***
Last login: Mon Feb 22 14:18:19 2021 from 133.25.196.25
reiji@reiji-PowerEdge-R740:~$ sudo useradd -s /bin/bash -d /opt/stack -m stack
[sudo] password for reiji:
reiji@reiji-PowerEdge-R740:~$ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
stack ALL=(ALL) NOPASSWD: ALL
reiji@reiji-PowerEdge-R740:~$ sudo su - stack
stack@reiji-PowerEdge-R740:~$ git clone https://opendev.org/openstack/devstack
Command 'git' not found, but can be installed with:
apt install git
Please ask your administrator.
stack@reiji-PowerEdge-R740:~$ apt update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
stack@reiji-PowerEdge-R740:~$ sudo apt update
Hit:1 http://jp.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Fetched 214 kB in 1s (275 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
stack@reiji-PowerEdge-R740:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
stack@reiji-PowerEdge-R740:~$ apt
apt 2.0.4 (amd64)
Usage: apt [options] command
apt is a commandline package manager and provides commands for
searching and managing as well as querying information about packages.
It provides the same functionality as the specialized APT tools,
like apt-get and apt-cache, but enables options more suitable for
interactive use by default.
Most used commands:
list - list packages based on package names
search - search in package descriptions
show - show package details
install - install packages
reinstall - reinstall packages
remove - remove packages
autoremove - Remove automatically all unused packages
update - update list of available packages
upgrade - upgrade the system by installing/upgrading packages
full-upgrade - upgrade the system by removing/installing/upgrading packages
edit-sources - edit the source information file
satisfy - satisfy dependency strings
See apt(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
This APT has Super Cow Powers.
stack@reiji-PowerEdge-R740:~$ git
Command 'git' not found, but can be installed with:
apt install git
Please ask your administrator
stack@reiji-PowerEdge-R740:~$ sudo apt install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
git-man liberror-perl
Suggested packages:
git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,464 kB of archives.
After this operation, 38.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 liberror-perl all 0.17029-1 [26.5 kB]
Get:2 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 git-man all 1:2.25.1-1ubuntu3 [884 kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 git amd64 1:2.25.1-1ubuntu3 [4,554 kB]
Fetched 5,464 kB in 1s (8,918 kB/s)
Selecting previously unselected package liberror-perl.
(Reading database ... 185865 files and directories currently installed.)
Preparing to unpack .../liberror-perl_0.17029-1_all.deb ...
Unpacking liberror-perl (0.17029-1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../git-man_1%3a2.25.1-1ubuntu3_all.deb ...
Unpacking git-man (1:2.25.1-1ubuntu3) ...
Selecting previously unselected package git.
Preparing to unpack .../git_1%3a2.25.1-1ubuntu3_amd64.deb ...
Unpacking git (1:2.25.1-1ubuntu3) ...
Setting up liberror-perl (0.17029-1) ...
Setting up git-man (1:2.25.1-1ubuntu3) ...
Setting up git (1:2.25.1-1ubuntu3) ...
Processing triggers for man-db (2.9.1-1) ...
stack@reiji-PowerEdge-R740:~$ git clone https://opendev.org/openstack/devstack
Cloning into 'devstack'...
remote: Enumerating objects: 46654, done.
remote: Counting objects: 100% (46654/46654), done.
remote: Compressing objects: 100% (21353/21353), done.
remote: Total 46654 (delta 32969), reused 37834 (delta 24591)
Receiving objects: 100% (46654/46654), 9.62 MiB | 2.39 MiB/s, done.
Resolving deltas: 100% (32969/32969), done.
stack@reiji-PowerEdge-R740:~$
```
# やっぱりちゃんとKVM構築する。