Deploying OpenStack with Devstack - Single Node

1. Deployment environment: VMware Workstation Ubuntu16.04 system (4G memory, 80G hard disk) Note: Network mode selection bridge

2. Devstack version: ocata

Third, the deployment process: (all commands are entered in the Ubuntu system terminal)

1. Install git: sudo apt-get install git

2. Modify the source of apt to a domestic source: (1) Open the file: vim /etc/apt/sources.list

(2) The modified content is:

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu / xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

2. Download the Devstack source code:git clone https://git.openstack.org/openstack-dev/devstack  -b stable / ocata

3. Create a stack user: devstack/tools/create-stack-user.sh

4. View pip: (1) Enter the command: pip

(2) If there is no prompt, please install: sudo apt-get install python-pip

5. Modify the pip source of root and stack users

(1) Under the root user: 1. Create a .pip directory: mkdir ~/.pip

                                2. Modify the source of pip: vim ~/.pip/pip.conf

                                3. The modification content is:

                                [global]
                                index-url= http://mirrors.aliyun.com/pypi/simple/
                                trusted-host= mirrors.aliyun.com

(2) Switch to stack user: su - stack

                                1. Create a .pip directory: mkdir ~/.pip

                                2. Modify the source of pip: vim ~/.pip/pip.conf

                                3. The modification content is:

                                [global]

                                index-url= http://mirrors.aliyun.com/pypi/simple/
                                trusted-host= mirrors.aliyun.com

6. Create the local.conf file in the devstack directory

(1)vim devstack/local.conf

(2) The content is: (Some parameters need to be modified, see the next section)

[[local|localrc]]

# use TryStack git mirror
#OFFLINE=True
RECLONE=True
# Define images to be automatically downloaded during the DevStack built process
# DOWNLOAD_DEFAULT_IMAGES=False
HOST_IP=192.168.1.141

# Credentials
DATABASE_PASSWORD=12345
ADMIN_PASSWORD=12345
SERVICE_PASSWORD=12345
SERVICE_TOKEN=12345
RABBIT_PASSWORD=12345
HORIZON_BRANCH = stable
KEYSTONE_BRANCH=stable/ocata
NOVA_BRANCH = stable
NEUTRON_BRANCH=stable/ocata
GLANCE_BRANCH=stable/ocata
CINDER_BRANCH=stable/ocata

#keystone
KEYSTONE_TOKEN_FORMAT=UUID
##Heat
HEAT_BRANCH=stable/ocata
enable_service h-eng h-api h-api-cfn h-api-cw

## Swift
SWIFT_BRANCH=stable/ocata
ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account
SWIFT_REPLICAS=1
SWIFT_HASH=011688b44136573e209e

# 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 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.102,end=192.168.1.110
PUBLIC_NETWORK_GATEWAY="192.168.1.2"
Q_L3_ENABLED=True
PUBLIC_INTERFACE=ens33
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex

# VLAN configuration.
Q_PLUGIN=ml2
ENABLE_TENANT_VLANS=True

# Logging
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs

LIBVIRT_TYPE=qemu

enable_service placement-api
enable_service placement-client

(3) Parameter modification

1.HOST_IP=192.168.1.141 - this IP address needs to be changed to the IP address of your Ubuntu system

2.DATABASE_PASSWORD=12345
ADMIN_PASSWORD=12345
SERVICE_PASSWORD=12345
SERVICE_TOKEN=12345
RABBIT_PASSWORD=12345

These can be customized, the password of ADMIN_PASSWORD can be used to log in to the horizon of OpenStack

3.HORIZON_BRANCH = stable

KEYSTONE_BRANCH=stable/ocata
NOVA_BRANCH = stable
NEUTRON_BRANCH=stable/ocata
GLANCE_BRANCH=stable/ocata
CINDER_BRANCH=stable/ocata

HEAT_BRANCH=stable/ocata

SWIFT_BRANCH=stable/ocata

The branches of these components should be consistent with the Devstack version branch you downloaded

4.FLOATING_RANGE="192.168.1.0/24"

Q_FLOATING_ALLOCATION_POOL=start=192.168.1.102,end=192.168.1.110
PUBLIC_NETWORK_GATEWAY="192.168.1.2"

These must be consistent with the address segment of your HOST_IP

5.PUBLIC_INTERFACE=ens33 - this one should be consistent with the network card of your Ubuntu system, you can use ifconfig to view in Ubuntu

6. Other parameters can be modified without modification

7. Run script deployment

(1) Switch to stack user: su - stack

(2) Enter the devstack directory: ./stack.sh

(3) Wait for the system to run the script by itself

When the content shown in the figure above appears, the deployment is successful. You can enter: http://HOST_IP/dashboard on the browser to access it.

8. The execution of the stack.sh script is generally not smooth sailing. There will be some errors in the middle. Be patient. If you have any questions, you can leave a message to communicate.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324739156&siteId=291194637