The purpose of DevStack is to provide a set of tools used to install the main OpenStack services from the sources needed for development and testing. DevStack also shows and describes examples of configurations and service launches, as well as using the command line client (CLI).
wiki.openstack.org/wiki/DevStack
sudo useradd -G sudo -m -U -s /bin/bash -p stack stack
su stack cd ~ git clone https://github.com/openstack-dev/devstack.git
sudo apt-get install git -y
stack@host:$ls devstack
stack@host:$cd devstack touch local.conf
nano local.conf [[local|localrc]]
############################################################ # Customize the following HOST_IP based on your installation ############################################################ ADMIN_PASSWORD=admin # Horizon & Keystone MYSQL_PASSWORD=admin RABBIT_PASSWORD=admin SERVICE_PASSWORD=admin SERVICE_TOKEN=admin
HOST_IP=10.0.2.15
#PUBLIC NETWORK CONFIGURATION Q_USE_PROVIDERNET_FOR_PUBLIC=False FLOATING_RANGE=10.0.2.0/24 Q_FLOATING_ALLOCATION_POOL="start=10.0.2.150,end=10.0.2.201" PUBLIC_NETWORK_NAME=external PUBLIC_NETWORK_GATEWAY=10.0.2.1 PUBLIC_PHYSICAL_NETWORK=public # Required for l3-agent to connect to external-network-bridge PUBLIC_BRIDGE=br-ext
#PRIVATE NETWORK CONFIGURATION NETWORK_GATEWAY=${NETWORK_GATEWAY:-15.0.0.1} FIXED_RANGE=${FIXED_RANGE:-15.0.0.0/24}
./stack.sh
This is your host IP address: 10.0.2.15 This is your host IPv6 address: ::1 Horizon is now available at http://10.0.2.15/dashboard Keystone is serving at http://10.0.2.15/identity/ The default users are: admin and demo The password: admin
. openrc admin admin
stack@host:~/devstack$ nova secgroup-list +----+---------+-------------+ | Id | Name | Description | +----+---------+-------------+ | 1 | default | default | +----+---------+-------------+
stack@host:~/devstack$ nova secgroup-list-rules default +-------------+-----------+---------+----------+--------------+ | IP Protocol | From Port | To Port | IP Range | Source Group | +-------------+-----------+---------+----------+--------------+ +-------------+-----------+---------+----------+--------------+
stack@host:~/devstack$ nova secgroup-add-rule default tcp 22 22 0.0.0.0/0 +-------------+-----------+---------+-----------+--------------+ | IP Protocol | From Port | To Port | IP Range | Source Group | +-------------+-----------+---------+-----------+--------------+ | tcp | 22 | 22 | 0.0.0.0/0 | | +-------------+-----------+---------+-----------+--------------+ stack@host:~/devstack$ nova secgroup-add-rule default icmp -1 255 0.0.0.0/0 +-------------+-----------+---------+-----------+--------------+ | IP Protocol | From Port | To Port | IP Range | Source Group | +-------------+-----------+---------+-----------+--------------+ | icmp | -1 | 255 | 0.0.0.0/0 | | +-------------+-----------+---------+-----------+--------------+ stack@host:~/devstack$ nova secgroup-add-rule default tcp 80 80 0.0.0.0/0 +-------------+-----------+---------+-----------+--------------+ | IP Protocol | From Port | To Port | IP Range | Source Group | +-------------+-----------+---------+-----------+--------------+ | tcp | 80 | 80 | 0.0.0.0/0 | | +-------------+-----------+---------+-----------+--------------+ stack@host:~/devstack$ nova secgroup-add-rule default tcp 443 443 0.0.0.0/0 +-------------+-----------+---------+-----------+--------------+ | IP Protocol | From Port | To Port | IP Range | Source Group | +-------------+-----------+---------+-----------+--------------+ | tcp | 443 | 443 | 0.0.0.0/0 | | +-------------+-----------+---------+-----------+--------------+
nova secgroup-list-rules default +-------------+-----------+---------+-----------+--------------+ | IP Protocol | From Port | To Port | IP Range | Source Group | +-------------+-----------+---------+-----------+--------------+ | tcp | 22 | 22 | 0.0.0.0/0 | | | icmp | -1 | 255 | 0.0.0.0/0 | | | tcp | 80 | 80 | 0.0.0.0/0 | | | tcp | 443 | 443 | 0.0.0.0/0 | | +-------------+-----------+---------+-----------+--------------+
stack@host:~/devstack$ nova keypair-list +-------+------+-------------------------------------------------+ | Name | Type | Fingerprint | +-------+------+-------------------------------------------------+ +-------+------+-------------------------------------------------+
$ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/stack/.ssh/id_rsa): cloud.key
$sudo chmod 600 cloud.key
stack@host:~/devstack$ nova keypair-add --pub-key cloud.key.pub cloud stack@host:~/devstack$ nova keypair-list +-------+------+-------------------------------------------------+ | Name | Type | Fingerprint | +-------+------+-------------------------------------------------+ | cloud | ssh | 6f:a7:c2:11:f0:e9:9c:77:43:fc:61:37:b4:e5:f9:b2 | +-------+------+-------------------------------------------------+
$nova image-list +--------------------------------------+---------------------------------+--------+--------+ | ID | Name | Status | Server | +--------------------------------------+---------------------------------+--------+--------+ | cc5fedc0-8331-4cfe-b2f0-27f264a81dde | cirros-0.3.4-x86_64-uec | ACTIVE | | | bc0d3c78-d48b-4b41-872d-5106e3392a3c | cirros-0.3.4-x86_64-uec-kernel | ACTIVE | | | 26bfbc17-1ea9-4a50-9075-5064a2b3d0ad | cirros-0.3.4-x86_64-uec-ramdisk | ACTIVE | | +--------------------------------------+---------------------------------+--------+--------+
$glance image-list +--------------------------------------+---------------------------------+ | ID | Name | +--------------------------------------+---------------------------------+ | cc5fedc0-8331-4cfe-b2f0-27f264a81dde | cirros-0.3.4-x86_64-uec | | bc0d3c78-d48b-4b41-872d-5106e3392a3c | cirros-0.3.4-x86_64-uec-kernel | | 26bfbc17-1ea9-4a50-9075-5064a2b3d0ad | cirros-0.3.4-x86_64-uec-ramdisk | +--------------------------------------+---------------------------------+
stack@host:~/devstack$ wget https://cloud-images.ubuntu.com/vivid/current/vivid-server-cloudimg-amd64-disk1.img
stack@host:~/devstack$ glance image-create --name ubuntu_vivid --visibility public --container-format ami --file vivid-server-cloudimg-amd64-disk1.img --disk-format ami
stack@host:~/devstack$ openstack server create srv1 --flavor=m1.small --image=ubuntu --key-name=cloud +--------------------------------------+-----------------------------------------------+ | Field | Value | +--------------------------------------+-----------------------------------------------+ | OS-DCF:diskConfig | MANUAL | | OS-EXT-AZ:availability_zone | | | OS-EXT-SRV-ATTR:host | None | | OS-EXT-SRV-ATTR:hypervisor_hostname | None | | OS-EXT-SRV-ATTR:instance_name | instance-00000001 | | OS-EXT-STS:power_state | NOSTATE | | OS-EXT-STS:task_state | scheduling | | OS-EXT-STS:vm_state | building | | OS-SRV-USG:launched_at | None | | OS-SRV-USG:terminated_at | None | | accessIPv4 | | | accessIPv6 | | | addresses | | | adminPass | SJZYQRUgoo3k | | config_drive | | | created | 2016-06-06T06:50:41Z | | flavor | m1.small (2) | | hostId | | | id | 706e906a-eb62-4927-afdf-e9a30b29c17f | | image | ubuntu (beb392b7-de7f-4fef-9afa-2cc5c2a38a13) | | key_name | cloud | | name | srv1 | | os-extended-volumes:volumes_attached | [] | | progress | 0 | | project_id | 7784247e5055485bb43c9f3311332d9a | | properties | | | security_groups | [{u'name': u'default'}] | | status | BUILD | | updated | 2016-06-06T06:50:41Z | | user_id | e54b731c7e1f40f4a5ad16d64be383bd | +--------------------------------------+-----------------------------------------------+
stack@host:~/devstack$ nova flavor-list +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+ | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+ | 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True | | 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True | | 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True | | 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True | +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
stack@host:~/devstack$ nova list +--------------------------------------+------+--------+------------+-------------+------------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+------+--------+------------+-------------+------------------+ | 706e906a-eb62-4927-afdf-e9a30b29c17f | srv1 | ACTIVE | - | Running | private=15.0.0.2 | +--------------------------------------+------+--------+------------+-------------+------------------+
stack@host:~/devstack$ ping 15.0.0.2 PING 15.0.0.2 (15.0.0.2) 56(84) bytes of data. 64 bytes from 15.0.0.2: icmp_seq=1 ttl=64 time=5.31 ms 64 bytes from 15.0.0.2: icmp_seq=2 ttl=64 time=0.470 ms 64 bytes from 15.0.0.2: icmp_seq=3 ttl=64 time=0.409 ms
stack@host:~/devstack$ ssh ubuntu@15.0.0.2 The authenticity of host '15.0.0.2 (15.0.0.2)' can't be established. ED25519 key fingerprint is 0e:56:2d:b0:d7:5f:27:bc:cd:39:ff:85:e6:84:a4:ef. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '15.0.0.2' (ED25519) to the list of known hosts. Permission denied (publickey).
stack@host:~/devstack$ ssh -i cloud.key ubuntu@15.0.0.2 Welcome to Ubuntu 15.04 (GNU/Linux 4.2.0-36-generic x86_64) … ubuntu@srv1:~$ pwd /home/ubuntu
stack@host:~/devstack$ nova floating-ip-list +----+----+-----------+----------+------+ | Id | IP | Server Id | Fixed IP | Pool | +----+----+-----------+----------+------+ +----+----+-----------+----------+------+
stack@astarove-VirtualBox:~/devstack$ nova floating-ip-create +----+----------+-----------+----------+----------+ | Id | IP | Server Id | Fixed IP | Pool | +----+----------+-----------+----------+----------+ | 1 | 10.0.2.1 | - | - | external | +----+----------+-----------+----------+----------+ stack@host:~/devstack$ nova floating-ip-create +----+----------+-----------+----------+----------+ | Id | IP | Server Id | Fixed IP | Pool | +----+----------+-----------+----------+----------+ | 2 | 10.0.2.2 | - | - | external | +----+----------+-----------+----------+----------+ stack@host:~/devstack$ nova floating-ip-list +----+----------+-----------+----------+----------+ | Id | IP | Server Id | Fixed IP | Pool | +----+----------+-----------+----------+----------+ | 1 | 10.0.2.1 | - | - | external | | 2 | 10.0.2.2 | - | - | external | +----+----------+-----------+----------+----------+
stack@host:~/devstack$ nova add-floating-ip srv1 10.0.2.1 stack@host:~/devstack$ nova list +--------------------------------------+------+--------+------------+-------------+----------------------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+------+--------+------------+-------------+----------------------------+ | 706e906a-eb62-4927-afdf-e9a30b29c17f | srv1 | ACTIVE | - | Running | private=15.0.0.2, 10.0.2.1 | +--------------------------------------+------+--------+------------+-------------+----------------------------+
stack@host:~/devstack$ ping 10.0.2.1 PING 10.0.2.1 (10.0.2.1) 56(84) bytes of data. 64 bytes from 10.0.2.1: icmp_seq=1 ttl=64 time=1.86 ms 64 bytes from 10.0.2.1: icmp_seq=2 ttl=64 time=0.410 ms ^C --- 10.0.2.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.410/1.136/1.863/0.727 ms stack@host:~/devstack$ ssh -i cloud.key ubuntu@10.0.2.1 The authenticity of host '10.0.2.1 (10.0.2.1)' can't be established. ED25519 key fingerprint is 0e:56:2d:b0:d7:5f:27:bc:cd:39:ff:85:e6:84:a4:ef. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.0.2.1' (ED25519) to the list of known hosts. … ubuntu@srv1:~$
stack@host:~/devstack$ nova remove-floating-ip srv1 10.0.2.1 stack@host:~/devstack$ nova list +--------------------------------------+------+--------+------------+-------------+------------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+------+--------+------------+-------------+------------------+ | 706e906a-eb62-4927-afdf-e9a30b29c17f | srv1 | ACTIVE | - | Running | private=15.0.0.2 | +--------------------------------------+------+--------+------------+-------------+------------------+
stack@host:~/devstack$ ./unstack.sh stack@host:~/devstack$ ./clean.sh
stack@host:~/devstack$ sudo rm -rf /opt/stack/*
stack@host:~/devstack$ ./stack.sh
sudo: unable to resolve host
cat /etc/hostname
nano /etc/hosts
stack@host:~/devstack$ ssh -i cloud.key ubuntu@15.0.0.3 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the ED25519 key sent by the remote host is c9:8e:70:27:1d:3b:c8:9c:b3:db:df:c2:a4:07:92:a1. Please contact your system administrator. Add correct host key in /home/stack/.ssh/known_hosts to get rid of this message. Offending ED25519 key in /home/stack/.ssh/known_hosts:2 remove with: ssh-keygen -f "/home/stack/.ssh/known_hosts" -R 15.0.0.3 ED25519 host key for 15.0.0.3 has changed and you have requested strict checking. Host key verification failed.
stack@host:~/devstack$ sudo rm /home/stack/.ssh/known_hosts
Source: https://habr.com/ru/post/302780/
All Articles