This experiment is a test environment for setting up virtual machine under VMware12. 1 Pre-preparatory work
Real Machine Environment WIN10
Linux version centos-everything-7.0
VMware version VMwareworkstations12
The virtual machine is configured as follows:
8G Memory
2-core CPU (Turn on virtualization)
Network configuration for Bridging mode
/boot 500M (be sure to make a big point or you'll encounter problems later)
Swap partition 4G
All the rest of the space is divided/partitioned
To configure the Yum source, you can keep the original CentOS with the official Yum source, or use the domestic mirror, the foreign mirror used in this experiment and use Fastestmirror, if the needs of friends can download repo source automatically constructs local Yum source method.
http://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-mitaka/
http://mirrors.163.com/centos/7/cloud/x86_64/openstack-mitaka/
Installing the Fastestmirror Plugin
Yum Install Yum-plugin-fastestmirror-y
Rpm-qa | Fastestmirror
Vim/etc/yum/pluginconf.d/fastestmirror.conf
The Hostfilepath field in the configuration file defines the configuration file for the Yum source, and we can write the known Yum source to this TXT file.
Run Yum check-update Check if configuration is in effect
In general, use the default settings of the Fastestmirror plug-in to meet your usage requirements. However, in some special cases of the network, the Fastestmirror plug-in may not be accurately judged. At this point, we can modify its ping response value to save the table:
Vim/var/cache/yum/x86_64/7/timedhosts.txt
If the Yum version is high, the work is configured by Yum and we just need to check it. 2
Yum install-y git
Yum Update upgrades your existing system to avoid various package incompatibility issues as much as possible. (Don't restart Now) 3
3 Turn off SELinux
Vim/etc/selinux.config
Selinux=disabled
Turn off other firewalls to keep only iptables
Systemctl Mask Ebtables
Systemctl Mask Firewalld
Systemctl Mask Ip6tables
Systemctl Enable Iptables
Restart the machine so that the update package is applied.
If boot partition space is found to be low after update upgrade, for example "XXX more space needed on the/boot filesystem", the boot partition needs to be expanded.
Back up the old boot partition first, for example I want to back it up to the/tmp/boot folder
Mkdir/tmp/boot
Cp-r/boot/*/tmp/boot
Umount/boot
Then the existing partition to expand or create a new partition, in the author's experimental environment,/boot partition only 200M, when the update is not error but after restarting the/boot partition is full of the file system has no spare partition, This time I can only add a new 500M virtual hard disk in the new partition. This time you need to first look at the partition in the table of the original partition is what format, it is best to be divided into the same format.
Vim/etc/fstab
Here my virtual machine/boot partition is EXT4 so my newly partitioned partition needs to be formatted into EXT4 format
Fdisk-l
Here, I can see my new/DEV/SDB disk.
Fdisk/dev/sdb
Partprobe
Mkfs.ext4/dev/sdb1
Blkid
Re-writes the received UUID to the/etc/fstab
At this point, mount the boot partition to copy the/tmp/boot file to the/boot partition. 4 Preparing Devstack
Mkdir-p/var/download/devstack
Cd/var/download/devstack
git clone https://github.com/openstack-dev/devstack.git-b Stable/mitaka
You can see this branche on the GitHub official website, we do the M version of the automated deployment of course selected M version.
Now that Devstack cannot run the stack.sh file through root, you need to create a stack user to run the stack.sh script as a stack user.
Cd/var/download/devstack/tools
./create-stac-user.sh
5. Modify the Devstack directory permissions so that the stack user can run
Chown-r Stack:stack/var/download/devstack
chmod 777/dev/pts/0 (First user login, console's device file is/dev/pts/0, the second is/DEV/PTS/1, and so on. /dev/pts is the directory where the console device files are created after remote login (TELNET,SSH, etc.)
chmod 777/opt/stack-r
(This is the default installation path when you automate the deployment of OpenStack, the default installation path can be modified in the local.conf file, and if you modify it, you need to reset the file directory path here.) )
* In the virtual machine environment, be sure to set the snapshot here for easy rollback.
#5配置local. conf file
As early as 2013, the LOCALRC file was replaced by the local.conf file. Now the LOCALRC file is still available but is not recommended.
Create the local.conf file under the Devstack file path. Two simple configurations are given here.
[[LOCAL|LOCALRC]] # use trystack git mirror git_base=http://git.trystack.cn novnc_repo=http://git.trystack.cn/kanaka/ Novnc.git spice_repo=http://git.trystack.cn/git/spice/spice-html5.git #OFFLINE =true reclone=true # Define images to be
Automatically downloaded during the Devstack built process. Download_default_images=false image_urls= "Http://images.trystack.cn/cirros/cirros-0.3.4-x86_64-disk.img" host_ip =192.168.1.6 # Credentials Database_password=pass admin_password=pass service_password=pass service_token=pass RABBIT _password=pass Horizon_branch=stable/mitaka Keystone_branch=stable/mitaka Nova_branch=stable/mitaka NEUTRON_BRANCH
=stable/mitaka Glance_branch=stable/mitaka Cinder_branch=stable/mitaka #keystone keystone_token_format=uuid # #Heat Heat_branch=stable/mitaka enable_service H-eng H-api h-api-cfn H-API-CW # # Swift Swift_branch=stable/mitaka ENABLED_SER Vices+=,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 FLOATIN G_range= "192.168.1.0/24" fixed_range= "10.0.0.0/24" q_floating_allocation_pool=start=192.168.1.10,end= 192.168.1.20 public_network_gateway= "192.168.1.1" Q_l3_enabled=true public_interface=eth0 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
The following configuration files are still a bit of a problem when deployed in my notebook because of the testing phase.
[[LOCAL|LOCALRC]] # use trystack git mirror git_base=http://git.trystack.cn novnc_repo=http://git.trystack.cn/kanaka/ Novnc.git spice_repo=http://git.trystack.cn/git/spice/spice-html5.git #Define Branches horizon_branch=stable/ Mitaka Keystone_branch=stable/mitaka Nova_branch=stable/mitaka Neutron_branch=stable/mitaka GLANCE_BRANCH=stable/ Mitaka Cinder_branch=stable/mitaka Ceilometer_branch=stable/mitaka Swift_branch=stable/mitaka #OFFLINE =true RECLONE =true #Directory dest=/var/openstack #Define target server IP address host_ip=192.168.1.6 # Define images to be automat
ically downloaded during the devstack built process. Download_default_images=false image_urls= "Http://foo.bar.com/image.qcow," image_urls+= "http://foo.bar.com/ Image2.qcow "image_urls+=" Http://mirrors.aliyun.com/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1511.iso "# Credentials database_password=pass admin_password=pass service_password=pass service_token=pass RABBIT_PASSWORD= Pass # Logging logfile= $DEST/logs/stack.Sh.log Logdays=1 logdir= $DEST/logs syslog=true syslog_host= $HOST _ip syslog_port=516 verbose=true log_color=true screen _logdir=/opt/stack/logs #Python option Use_venv=true pip_upgrade=true project_venv["Glance"]=${glance_dir}. Venv project_venv["Nova"]=${nova_dir}. Venv project_venv["Keystone"]=${keystone_dir}. Venv project_venv["Neutron"]=${neutron_dir}. Venv project_venv["Cinder"]=${cinder_dir}. Venv project_venv["Swift"]=${swift_dir}. Venv project_venv["Glance"]=${glance_dir}. Venv project_venv["Heat"]=${heat_dir}. Venv additional_venv_packages= "Python-foo,python-bar" #Define default instance Standard default_instance_type= M1.tiny #keystone keystone_token_format=uuid keystone_use_mod_wsgi= "True" Enable_identity_v2=false # #vnc ENABLED_ Services+=,n-spice,n-novnc,n-xvnc # #Glance Enabled_services+=,g-api.g-reg # #Heat Heat_branch=stable/mitaka enable_ Service H-eng h-api h-api-cfn h-api-cw h-eng heat_use_mod_wsgi= "True" # # Swift Swift_branch=stable/mitaka ENABLED_SERVIC Es+=,s-proxy,s-objecT,s-container,s-account Swift_replicas=1 swift_hash=011688b44136573e209e swift_use_mod_wsgi= "True" # Enabling Neutron (Network) Service Disable_service n-net # #Do not use Nova network 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 O ptions 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.10,end=192.168.1.20 public_network_gateway= "192.168.1.1" Q_l3_enabled=true PUBLIC_INTERFACE=eth0 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 # #Cinder Enabled_services+=,cinder,c-api,c-vol,c-sch,c-bak CINDER_USE_MOD_
Wsgi= "True" volume_group= "Stack-volumes" volume_name_prefix= "volume-" volume_backing_file_size=10250m # #Ceilometer Enabled_services+=,ceilometer-acomputer,ceilometer-acEntral,ceilometer-collector,ceilometer-api Enabled_services+=,ceilometer-alarm-notify,ceilometer-alarm-eval Enabled_services+=,trove,tr-api,tr-tmgr,tc-cond #Apache Apache_enabled_services+=,keystone
6 Something
If the password is not specified in the initial profile,/stack.sh will let you enter it interactively. And the password is best written in front of the configuration file location, I try to write in the back of the position or will be the same prompt me to enter the password.
ENTER A PASSWORD to use for the DATABASE.
This value would be a written To/var/download/devstack/.localrc.password file so you don't have the to enter it
Again. Use only alphanumeric characters.
If you leave this blank, a random default value would be used.
Enter a password now:
Prompt to enter rabbit password:
ENTER A PASSWORD to use for RABBIT.
This value would be a written To/var/download/devstack/.localrc.password file so you don't have the to enter it
Again. Use only alphanumeric characters.
If you leave this blank, a random default value would be used.
Enter a password now:
Prompt to enter the service password:
ENTER A Service_password to use for the SERVICE authentication.
This value would be a written To/var/download/devstack/.localrc.password file so you don't have the to enter it
Again. Use only alphanumeric characters.
If you leave this blank, a random default value would be used.
Enter a password now:
Prompt for password for Keystone and horizon:
ENTER A PASSWORD to use for HORIZON and KEYSTONE (CHARS OR less).
This value would be a written To/var/download/devstack/.localrc.password file so you don't have the to enter it
Again. Use only alphanumeric characters.
If you leave this blank, a random default value would be used.
Enter a password now:
In short, the posture will not encounter a variety of Python-related problems. And the first time you've configured it, you'll also get a problem when you use the Clean.sh script to clear it up and configure it with different configuration items. (may not have been removed cleanly before.) )
For example:
This is me. Use the second deployment file to configure an error after the first configuration file is deployed successfully. Actually my pip is installed. For this I restore the snapshot to the initial location of the reconfiguration did not find such a problem.
Finally, a successful deployment screenshot: