In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "how to install OpenStack on a single node of Ubuntu16". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install OpenStack on a single node of Ubuntu16.
Package installation and basic configuration
Reference documentation:
"OpenStack Installation Tutorial for Ubuntu"
Basic network configuration
Configure the IP address:
Ipaddr: 192.168.195.160netmask: 255.255.255.0gateway: 192.168.195.2dns: 114.114.114.114
Configure hostname:
$vi / etc/hostnameUbuntuStack
Configure native DNS resolution:
$vi / etc/hosts127.0.0.1 ubuntustack
Configure the network card:
$vi / etc/network/interfaces# The provider network interfaceauto ens33iface ens33 inet manualup ip link set dev $IFACE updown ip link set dev $IFACE down install and configure the NTP service
Install the chrony service:
$apt-get install chrony
Configure the NTP server address, where the NTP server in Asia is selected, and all "192.168 Universe 16" segments are allowed to obtain NTP services from here.
$vi / etc/chrony/chrony.confserver 0.asia.pool.ntp.org iburstserver 1.asia.pool.ntp.org iburstserver 2.asia.pool.ntp.org iburstallow 192.168Universe 16
Restart the chrony service:
$service chrony restart
Verify the NTP service with a note with "*" that has been synchronized recently.
$chronyc sources210 Number of sources = 10MS Name/IP address Stratum Poll Reach LastRx Last sample==== ^-27.114.150.12 2 6 359 + 104ms [+ 104ms] + /-336ms ^-x.ns.gin.ntt.net 2 6 338-44ms [- 44ms] + /-209ms ^-ntp.tums.ac.ir 36 123 3 + 577us [ + 577us] + /-410ms ^-120.25.115.19 2 6 17 14 + 2132us [+ 2132us] + /-74ms ^-59.46.44.253 2 6 33 11 + 734us [+ 734us] + /-78ms ^ * news.neu.edu.cn 2 6 17 14 + 647us [+ 4083us] + /-21ms ^? 2001:da8:9000::130 0 6 010y + 0ns [+ 0ns] + /-0ns ^? 2400:a480:f:420:d2::bd 06010y + 0ns [+ 0ns] + /-0ns ^ + 2001:da8:9000::81 06010y + 0ns [+ 0ns] + /-0ns ^? 2001:da8:202:10::61 06010y + 0ns [ + 0ns] + /-0ns install OpenStack package $apt-get install software-properties-common$ add-apt-repository cloud-archive:newton$ apt-get update & & apt dist-upgrade$ apt-get install python-openstackclient installation and configuration data base
Install the MariaDB package:
$apt install mariadb-server python-pymysql
Configure MariaDB parameters:
$vi / etc/mysql/mariadb.conf.d/99-openstack.cnf [mysqld] bind-address = 192.168.195.160default-storage-engine = innodbinnodb_file_per_tablemax_connections = 4096collation-server = utf8_general_cicharacter-set-server = utf8
Restart MariaDB:
$service mysql restart
Configure the database:
Mysql_secure_installationEnter current password for root (enter for none): > Set root password? [yNew password] > yNew password: > openstackRe-enter new password: > openstackRemove anonymous users? [YBO] > nDisallow root login remotely? [YBO] > nRemove test database and access to it? [YBO] > nReload privilege tables now? [YBO] > y
Verify the database service:
$mysql-uroot-pEnter password: > openstack > quit install and configure the message queuing service
Install RabbitMQ:
$apt install rabbitmq-server
Configure the user name and password:
$rabbitmqctl add_user openstack openstackCreating user "openstack"... $rabbitmqctl set_permissions openstack ". *" Setting permissions for user "openstack" in vhost "/". Install and configure the Memcached service
Install the Memcached package:
$apt install memcached python-memcache
Basic configuration:
$vi / etc/memcached.conf-l 192.168.195.160
Restart the service:
$service memcached restart install and configure the authentication service configuration KeyStore database
Create a KeyStore database:
$mysql-u root-p > openstack > CREATE DATABASE keystone; > GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY' openstack'; > GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY' openstack'; > quit
Configure the database URL:
$vi / etc/keystone/ keystone.conf.[ database]... connection = mysql+pymysql://keystone:openstack@ubuntustack/keystone...
Configure the Fernet Key repository Token:
$vi / etc/keystone/ keystone.conf.[ token]... provider = fernet...
Synchronize the database:
$su-s / bin/sh-c "keystone-manage db_sync" keystone initializes the KeyStore Fernet Key repository $keystone-manage fernet_setup-- keystone-user keystone--keystone-group keystone$ keystone-manage credential_setup-- keystone-user keystone--keystone-group keystone starts the KeyStore service
Initialize the KeyStore service:
$keystone-manage bootstrap--bootstrap-password openstack\-- bootstrap-admin-url http://ubuntustack:35357/v3/\-- bootstrap-internal-url http://ubuntustack:35357/v3/\-- bootstrap-public-url http://ubuntustack:5000/v3/\-- bootstrap-region-id RegionOne
Configure the Apache2 service name:
$vi / etc/apache2/apache2.conf...ServerName ubuntustack...
Restart the Apache2 service:
$service apache2 restart$ rm-fv / var/lib/keystone/keystone.db configure KeyStore permissions
Set the administrator environment variable:
$export OS_USERNAME=admin$ export OS_PASSWORD=openstack$ export OS_PROJECT_NAME=admin$ export OS_USER_DOMAIN_NAME=default$ export OS_PROJECT_DOMAIN_NAME=default$ export OS_AUTH_URL= http://ubuntustack:35357/v3$ export OS_IDENTITY_API_VERSION=3
Create a Project:
$openstack project create-domain default\-description "Service Project" service+-+--+ | Field | Value | +-+- -+ | description | Service Project | | domain_id | default | | enabled | True | | id | 2493d51774e64be1ae97041768b73d98 | | is_domain | False | | name | service | | parent_id | Default | +-+-- + $openstack project create-domain default\-description "Demo Project" demo+-+-- -+ | Field | Value | +-+-+ | description | Demo Project | | domain_id | default | | enabled | True | | id | c7ddc0ecab64419486df0d7f66e8174c | | is_domain | False | | name | demo | | parent_id | default | +-- + |
Create a User:
$openstack user create-- domain default\-- password-prompt demoUser Password: > openstackRepeat User Password: > openstack+-+--+ | Field | Value | +- -+-+ | domain_id | default | | enabled | True | | id | ffff52bbf1da4c86a3d2b57e977f6b82 | | name | demo | | password_expires_at | None | +-- + |
Create a Role:
$openstack role create user+-+--+ | Field | Value | +-+-+ | domain_ Id | None | | id | 314d4ba677ef4f6d92c53f00e470be1b | | name | user | +-+-+
Add a Role to the Project:
$openstack role add-- project demo-- user demo user verifies the KeyStore service
Edit the "/ etc/keystone/keystone-paste.ini" file and remove "admin_token_auth" from the "[pipeline:public_api]", "[pipeline:admin_api]" and "[pipeline:api_v3]" sections.
Unset the "OS_AUTH_URL" and "OS_PASSWORD" environment variables:
$unset OS_AUTH_URL OS_PASSWORD
Request an admin authentication Token:
$openstack-- os-auth-url http://ubuntustack:35357/v3\-- os-project-domain-name default-- os-user-domain-name default\-- os-project-name admin-- os-username admin token issuePassword: > openstack+-+--+ | Field | Value | | +-+-- + | expires | 2016-11-28 09WRV 55 ab3f069806b24fd29869eac1d6ccbbc8 28000Rang00 | | id | ab3f069806b24fd29869eac1d6ccbbc8 | | project_id | c77f9d27e4f5496092357ff991d1639b | | user_id | 5524cbf52bf440deb5e3e8ccd074a267 | +-+-| -- +
Request a demo authentication Token:
$openstack-- os-auth-url http://ubuntustack:5000/v3\-- os-project-domain-name default-- os-user-domain-name default\-- os-project-name demo-- os-username demo token issuePassword: > openstack+-+--+ | Field | Value | | +-+-- + | expires | 2016-11-28 09VG 56RV 2500Ranger 00 | | id | 628a27e1ae1847ea968186122d158ee6 | | project_id | c7ddc0ecab64419486df0d7f66e8174c | | user_id | ffff52bbf1da4c86a3d2b57e977f6b82 | +-+-| -+ create OpenStack client environment variable script
Create a script for admin user environment variables:
$vi admin-openrcexport OS_PROJECT_DOMAIN_NAME=defaultexport OS_USER_DOMAIN_NAME=defaultexport OS_PROJECT_NAME=adminexport OS_USERNAME=adminexport OS_PASSWORD=openstackexport OS_AUTH_URL= http://ubuntustack:35357/v3export OS_IDENTITY_API_VERSION=3export OS_IMAGE_API_VERSION=2
Create a script for demo user environment variables:
$vi demo-openrcexport OS_PROJECT_DOMAIN_NAME=defaultexport OS_USER_DOMAIN_NAME=defaultexport OS_PROJECT_NAME=demoexport OS_USERNAME=demoexport OS_PASSWORD=openstackexport OS_AUTH_URL= http://ubuntustack:5000/v3export OS_IDENTITY_API_VERSION=3export OS_IMAGE_API_VERSION=2
Verify the admin user environment variable script:
$. Admin-openrc$ openstack token issue+-+--+ | Field | Value | + + | expires | 2016-11-28 09VRV 591800JV | | id | 5192190f959545288ed4095b7cc2af1f | | project_id | c77f9d27e4f5496092357ff991d1639b | | user_id | 5524cbf52bf440deb5e3e8ccd074a267 | +-- +-- + install and configure image service
Create a Glance database:
$mysql-u root-p > openstack > CREATE DATABASE glance; > GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY' openstack'; > GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY' openstack'; > quit
Set the admin environment variable:
$. Admin-openrc configure KeyStore authentication for Glance
To create a Glance user:
$openstack user create-domain default-password-prompt glanceUser Password: > openstackRepeat User Password: > openstack+-+--+ | Field | Value | +- -+-+ | domain_id | default | | enabled | True | | id | 0333d28a75824b81a73d9c99ed0d6a09 | | name | glance | | password_expires_at | None | +-- + |
Add the Glance user to the administrator role of the service:
$openstack role add-project service-user glance admin
To create a Glance service:
$openstack service create-name glance\-description "OpenStack Image" image+-+--+ | Field | Value | +-+- -+ | description | OpenStack Image | | enabled | True | | id | 64e1b1473cba4c3395c1aef20ae1b5d9 | | name | glance | | type | image | +-+- -+
Create a public EndPoint for the Glance service:
$openstack endpoint create-region RegionOne image public http://ubuntustack:9292+--------------+----------------------------------+| Field | Value | +-+- -+ | enabled | True | | id | 6ba33ab89e2b4d8bb4c8583add6aaeee | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 64e1b1473cba4c3395c1aef20ae1b5d9 | | service_name | glance | | service_type | image | | url | http://ubuntustack:9292 | +-- + |
Create the internal EndPoint of the Glance service:
$openstack endpoint create-region RegionOne image internal http://ubuntustack:9292+--------------+----------------------------------+| Field | Value | +-+- -+ | enabled | True | | id | 2bbde57b9ddb4ae78ed825258c1b1e5e | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 64e1b1473cba4c3395c1aef20ae1b5d9 | | service_name | glance | | service_type | image | | url | http://ubuntustack:9292 | +-- + |
Create a management EndPoint for the Glance service:
$openstack endpoint create-region RegionOne image admin http://ubuntustack:9292+--------------+----------------------------------+| Field | Value | +-+- -+ | enabled | True | | id | b09eb627b221453e8ffdd99d7df7e67a | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 64e1b1473cba4c3395c1aef20ae1b5d9 | | service_name | glance | | service_type | image | | url | http://ubuntustack:9292 | +-+-- + install and configure Glance service |
Install the Glance package
$apt-get install glance
Configure the Glance API service:
$vi / etc/glance/glance-api.conf [database]... connection = mysql+pymysql://glance:openstack@ubuntustack/ glass [Keystone _ authtoken]... auth_uri = http://ubuntustack:5000auth_url = http://ubuntustack:35357memcached_servers = ubuntustack:11211auth_type = passwordproject_domain_name = defaultproject_name = serviceusername = glancepassword = openstack [opening _ deploy]. Flavor = Keystone [glance _ store]... stores = file,httpdefault_store = filefilesystem_store_datadir = / opt/stack/images/
Configure the Glance Registery service:
$vi / etc/glance/glance-registry.conf [database]... connection = mysql+pymysql://glance:openstack@ubuntustack/ glass [Keystone _ authtoken]... auth_uri = http://ubuntustack:5000auth_url = http://ubuntustack:35357memcached_servers = ubuntustack:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = glancepassword = openstack [opening _ deploy]. Flavor = keystone
Synchronize the Glance database:
$su-s / bin/sh-c "glance-manage db_sync" glance
Create an image save directory:
$mkdir-pv / opt/stack/images$ chown glance:glance / opt/stack/images$ chmod 744 / opt/stack/images
Restart the Glance service:
$service glance-registry restart$ service glance-api restart verifies Glance service
Set the administrator environment variable:
$. Admin-openrc
Download the test image:
$wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
Add a test image to the Glance repository:
$openstack image create "cirros"\-file cirros-0.3.4-x86_64-disk.img\-disk-format qcow2-container-format bare\-public+-+ + | Field | Value | +-+-- + | checksum | ee1eca47dc88f4879d8a229cc70a07c6 | | container_format | bare | | created_at | 2016-11-28T21:14:49Z | | disk_format | qcow2 | | file | / v2/images/e345e8b0-71b7-44e0Murb1a1- E168f85a19f6/file | | id | e345e8b0-71b7-44e0-b1a1-e168f85a19f6 | | min_disk | 0 | min_ram | 0 | | name | cirros | | owner | c77f9d27e4f5496092357ff991d1639b | | protected | False | | schema | / v2/schemas/image | | size | 13287936 | | | status | active | | tags | updated_at | 2016-11-28T21:14:49Z | | virtual_size | None | | | visibility | public | +-+-- +
View the joined images:
$openstack image list+--+ | ID | Name | Status | +-- -+ | e345e8b0-71b7-44e0-b1a1-e168f85a19f6 | cirros | active | +-+ install and configure computing services
Create a Nova database:
$mysql-u root-pEnter password: > openstack > CREATE DATABASE nova_api; > GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY' openstack'; > GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY' openstack'; > CREATE DATABASE nova; > GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY' openstack'; > GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY' openstack'; > quit
Set the administrator environment variable:
$. Admin-openrc configure KeyStore authentication for Nova
To create a Nova user:
$openstack user create-domain default-password-prompt novaUser Password: > openstackRepeat User Password: > openstack+-+--+ | Field | Value | +- -+-+ | domain_id | default | | enabled | True | | id | e69cc08aab424e32b890b25621eef471 | | name | nova | | password_expires_at | None | +-- + |
Add Nova users to the administrator role of the service:
$openstack role add-project service-user nova admin
To create a Nova service:
$openstack service create-- name nova-- description "OpenStack Compute" compute+-+--+ | Field | Value | +-- -+ | description | OpenStack Compute | | enabled | True | | id | 472934388a194c36a80295c267e5252f | | name | nova | | type | compute | +-+- -- +
Create a public EndPoint for the Nova service:
$openstack endpoint create-region RegionOne compute public http://ubuntustack:8774/v2.1/%\(tenant_id\)s+--------------+--------------------------------------------+| Field | Value | + -+-- + | enabled | True | | id | 74f5e21c114a48d68782a886ff6c4ca7 | | interface | public | | region | | RegionOne | | region_id | RegionOne | | service_id | 472934388a194c36a80295c267e5252f | | service_name | nova | | service_type | compute | | url | http://ubuntustack:8774/v2. | 1According% (tenant_id) s | +-+-+
Create the internal EndPoint of the Nova service:
$openstack endpoint create-region RegionOne compute internal http://ubuntustack:8774/v2.1/%\(tenant_id\)s+--------------+--------------------------------------------+| Field | Value | + -+-- + | enabled | True | | id | 2cdc0c65e9e04136bf08e1ec913eaadb | | interface | internal | | region | | RegionOne | | region_id | RegionOne | | service_id | 472934388a194c36a80295c267e5252f | | service_name | nova | | service_type | compute | | url | http://ubuntustack:8774/v2.1 | /% (tenant_id) s | +-+-+
Create a management EndPoint for the Nova service:
$openstack endpoint create-region RegionOne compute admin http://ubuntustack:8774/v2.1/%\(tenant_id\)s+--------------+--------------------------------------------+| Field | Value | + -+-- + | enabled | True | | id | 47ace5dab56940cbbac20b43abedadb9 | | interface | admin | | region | | RegionOne | | region_id | RegionOne | | service_id | 472934388a194c36a80295c267e5252f | | service_name | nova | | service_type | compute | | url | http://ubuntustack:8774/v2. | 1According% (tenant_id) s | +-+-+ install and configure Nova service
Install the Nova package:
$apt-get install nova-api nova-conductor nova-consoleauth nova-novncproxy nova-scheduler nova-compute
Configure the Nova service:
$vi / etc/nova/ Nova confession [default]... transport_url = rabbit://openstack:openstack@ubuntustackauth_strategy = keystonemy_ip = 192.168.195.160use_neutron = Truefirewall_driver = nova.virt.firewall.NoopFi rewallDriver [API _ database]... connection = mysql+pymysql://nova:openstack@ubuntustack/nova_ API [database]... connection = mysql+pymysql://nova:openstack@ubuntustack/ Nova [Keystone _ authtoken]... auth_uri = http://ubuntustack:5000auth_url = http://ubuntustack:35357memcached_servers = ubuntustack:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = novapassword = openstack [VNC]. Vncserver_listen = $my_ipvncserver_proxyclient_address = $my_ipenabled = Truenovncproxy_base_url = http://ubuntustack:6080/vnc_auto.html[glance]...api_servers = http://ubuntustack:9292[oslo_concurrency]...lock_path = / var/lib/nova/tmp
Configure the Nova virtual machine type:
$vi / etc/nova/nova-compute.conf [libvirt]... virt_type = qemu
Synchronize the Nova database:
$su-s / bin/sh-c "nova-manage api_db sync" nova$ su-s / bin/sh-c "nova-manage db sync" nova
Restart the Nova service:
$service nova-api restart & & service nova-consoleauth restart & & service nova-scheduler restart & &\ service nova-conductor restart & service nova-novncproxy restart & & service nova-compute restart validates the Nova service
Set the administrator environment variable:
$. Admin-openrc
View the status of computing services:
$openstack compute service list+----+-+--+ | ID | Binary | Host | Zone | Status | | State | Updated At | +-+-- + | 4 | nova-consoleauth | UbuntuStack | internal | Enabled | up | 2016-11-28T21:51:28.000000 | 5 | nova-scheduler | UbuntuStack | internal | enabled | up | 2016-11-28T21:51:32.000000 | 6 | nova-conductor | UbuntuStack | internal | enabled | up | 2016-11-28T21:51:32.000000 | 8 | nova-compute | UbuntuStack | nova | enabled | up | 2016-11-28T21:51:28.000000 | +-+- -+
View the Nova log:
$vi / var/log/nova/nova-compute.log install and configure network services
Create a Neutron database:
$mysql-u root-p > openstack > CREATE DATABASE neutron; > GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY' openstack'; > GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY' openstack'; > quit
Set the administrator environment variable:
$. Admin-openrc configure KeyStore authentication for Neutron
To create a Neutron user:
$openstack user create-domain default-password-prompt neutronUser Password: > openstackRepeat User Password: > openstack+-+--+ | Field | Value | +- -+-+ | domain_id | default | | enabled | True | | id | da9bf75b6a4041d1b9aba7b236026a2d | | name | neutron | | password_expires_at | None | +-- + |
Add Neutorn to the administrative role of the service:
$openstack role add-project service-user neutron admin
To create a Neutron service:
$openstack service create-- name neutron-- description "OpenStack Networking" network+-+--+ | Field | Value | +-- -+ | description | OpenStack Networking | | enabled | True | | id | 7d3567ffbc4941dd800f445eab76ded9 | | name | neutron | | type | network | +-+- -+
Create a public EndPoint for the Neutron service:
$openstack endpoint create-region RegionOne network public http://ubuntustack:9696+--------------+----------------------------------+| Field | Value | +-+- -+ | enabled | True | | id | b55696fa3198466a9def11bda1263caf | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 7d3567ffbc4941dd800f445eab76ded9 | | service_name | neutron | | service_type | network | | url | http://ubuntustack:9696 | +-- + |
Create the internal EndPoint of the Neutron service:
$openstack endpoint create-region RegionOne network internal http://ubuntustack:9696+--------------+----------------------------------+| Field | Value | +-+- -+ | enabled | True | | id | 26f5c0b68e134e87bd95a3ae8aa676f1 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 7d3567ffbc4941dd800f445eab76ded9 | | service_name | neutron | | service_type | network | | url | http://ubuntustack:9696 | +-- + |
Create a management EndPoint for the Neutron service:
$openstack endpoint create-region RegionOne network admin http://ubuntustack:9696+--------------+----------------------------------+| Field | Value | +-+- -+ | enabled | True | | id | 8149bf9a36ce4e53884bd3a766dfb116 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 7d3567ffbc4941dd800f445eab76ded9 | | service_name | neutron | | service_type | network | | url | http://ubuntustack:9696 | +-+-- + install and configure Neutron service |
Install the Neutron package:
$apt-get install neutron-server neutron-plugin-ml2 neutron-linuxbridge-agent neutron-l3-agent neutron-dhcp-agent neutron-metadata-agent
Configure the Neutron service:
$vi / etc/neutron/ accounon.confs [database]... connection = mysql+pymysql://neutron:openstack@ubuntustack/ roomon [default]... core_plugin = ml2service_plugins = routerallow_overlapping_ips = Truetransport_url = rabbit://openstack:openstack@ubuntustackauth_strategy = keystonenotify_nova_on_port_status_changes = Truenotify_nova_on_port_data_changes = True [Keystone _ authtoken]... auth_uri = http://ubuntustack:5000auth_url = http://ubuntustack:35357memcached_ Servers = ubuntustack:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = neutronpassword = openstack [nova]... auth_url = http://ubuntustack:35357auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultregion_name = RegionOneproject_name = serviceusername = novapassword = openstack
Configure the "Self-Service" network
# Configure the Modular Layer 2 (ML2) plug-in$ vi / etc/neutron/plugins/ml2/ml2_ conf.ini [ml2]... type_drivers = flat,vlan,vxlantenant_network_types = vxlanmechanism_drivers = linuxbridge,l2populationextension_drivers = port_ security [ml2 _ type_flat]... flat_networks = provider [ml2 _ type_vxlan]... vni_ranges = 1lv1000 [securitygroup]... enable_ipset = True
Configure the Linux Bridge Agent:
$vi / etc/neutron/plugins/ml2/linuxbridge_ agent.ini [Linux _ bridge] physical_interface_mappings = provider: ens33 [VXlan] enable_vxlan = Truelocal_ip = 192.168.195.160l2_population = True [securitygroup]... enable_security_group = Truefirewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
Configure the Layer 3 agent:
$vi / etc/neutron/l3_ agent.ini [default]... interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
Configure the DHCP agent:
$vi / etc/neutron/dhcp_ agent.ini [default]... interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriverdhcp_driver = neutron.agent.linux.dhcp.Dnsmasqenable_isolated_metadata = True
Configure the metadata proxy:
$vi / etc/neutron/metadata_ agent.ini [default]... nova_metadata_ip = ubuntustackmetadata_proxy_shared_secret = openstack
Configure the Nova service to use the Neutron service:
$vi / etc/nova/ Nova.confon [on]... url = http://ubuntustack:9696auth_url = http://ubuntustack:35357auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultregion_name = RegionOneproject_name = serviceusername = neutronpassword = openstackservice_metadata_proxy = Truemetadata_proxy_shared_secret = openstack
Synchronize the Neutron database:
$su-s / bin/sh-c "neutron-db-manage-- config-file / etc/neutron/neutron.conf\-- config-file / etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
Restart the Nova and Neutron services:
$service nova-api restart$ service neutron-server restart & & service neutron-linuxbridge-agent restart & &\ service neutron-dhcp-agent restart & & service neutron-metadata-agent restart$ service neutron-l3-agent restart$ service nova-compute restart validates the Neutron service
Set administrator environment variables
$. Admin-openrc
View the Neutron extension:
$neutron ext-list+--+---+ | alias | name | +- -- +-- + | default-subnetpools | Default Subnetpools | | network-ip-availability | Network IP Availability | | network_availability_ Zone | Network Availability Zone | | auto-allocated-topology | Auto Allocated Topology Services | | ext-gw-mode | Neutron L3 Configurable external gateway mode | | binding | Port Binding | | agent | agent | | subnet_ Allocation | Subnet Allocation | | l3_agent_scheduler | L3 Agent Scheduler | | tag | Tag support | | external-net | Neutron external network | | flavors | Neutron Service Flavors | | net-mtu | Network MTU | | availability_zone | Availability Zone | | quotas | Quota management support | | l3-ha | HA Router extension | | | provider | Provider Network | | multi-provider | Multi Provider Network | | address-scope | Address scope | | extraroute | Neutron Extra Route | | subnet-service-types | Subnet service types | | standard-attr-timestamp | Resource timestamps | | service-type | Neutron Service Type Management | | l3-flavors | Router Flavor Extension | | port-security | Port Security | | extra_dhcp_ Opt | Neutron Extra DHCP opts | | standard-attr-revisions | Resource revision numbers | | pagination | Pagination support | | sorting | Sorting support | | security-group | security-group | | dhcp_agent_scheduler | DHCP Agent Scheduler | | router_availability_zone | Router Availability Zone | | rbac-policies | RBAC Policies | | standard-attr-description | standard-attr-description | | router | Neutron L3 Router | | | allowed-address-pairs | Allowed Address Pairs | | project-id | project_id field enabled | | dvr | Distributed Virtual Router | +-| -- +
View the network agent:
$openstack network agent list+--+-+- -- + | ID | Agent Type | Host | Availability Zone | Alive | State | Binary | +-+- -+ | 3d9ec505-1ec9-48a9-9f2f-a5b769fbd77e | L3 agent | UbuntuStack | nova | True | UP | neutron-l3-agent | | 3ee2203d-d462-453a-990c-d6646a1262b7 | Linux bridge agent | UbuntuStack | None | True | UP | neutron-linuxbridge-agent | | 87ccc0a5-e686-4e04-ad75-b066be2771e9 | Metadata agent | UbuntuStack | None | True | UP | neutron-metadata-agent | | deaf9d1b-d2b0-4706-be37-5fbdc0d16abf | DHCP agent | UbuntuStack | nova | True | UP | neutron-dhcp -agent | +-- + -+ start a virtual machine instance to create and configure the "Provider" network
Set the administrator environment variable:
$. Admin-openrc
Create a "Provider" network:
$openstack network create-share-provider-physical-network provider--provider-network-type flat provider+--+--+ | Field | Value | + -- +-+ | admin_state_up | UP | | availability_zone_hints | | | availability_zones | | created_at | 2016-11-28T23:15:05Z | | description | | headers | | id | | | 716eaea1-3b1b-459a-a601-4b9a0d3266e3 | | ipv4_address_scope | None | | ipv6_address_scope | None | | mtu | 1500 | name | provider | | | port_security_enabled | True | | project_id | c77f9d27e4f5496092357ff991d1639b | | project_id | c77f9d27e4f5496092357ff991d1639b | | provider:network_type | flat | | provider:physical_network | provider | | provider:segmentation_ | Id | None | | revision_number | 3 | | router:external | Internal | | shared | True | | status | ACTIVE | | subnets | | tags | [] | | updated_at | 2016-11-28T23:15:05Z | +- -+
Create a subnet for the "Provider" network:
$openstack subnet create-network provider\-allocation-pool start=192.168.195.200 End=192.168.195.230\-- dns-nameserver 114.114.114.114-- gateway 192.168.195.2\-- subnet-range 192.168.195.0 Field 24 provider+-+--+ | Field | Value | | +-+-+ | allocation_pools | 192.168.195.200-192.168.195.230 | | cidr | 192.168.195.0 hand 24 | | | created_at | 2016-11-28T23:19:49Z | | description | | dns_nameservers | 114.114.114.114 | | enable_dhcp | True | | gateway_ip | 192.168.195.2 | | | headers | | host_routes | id | b8d66c38-2770-46f0-bbc1-6010b995d5af | | ip_version | 4 | | ipv6_address_mode | None | | | ipv6_ra_mode | None | | name | provider | | network_id | 716eaea1-3b1b-459a-a601-4b9a0d3266e3 | | project_id | c77f9d27e4f5496092357ff991d1639b | | project_id | c77f9d27e4f5496092357ff991d1639b | | revision_number | 2 | | service_ | Types | [] | subnetpool_id | None | | updated_at | 2016-11-28T23:19:49Z | + -+ create and configure "Self-Service" network
Set the test user environment variables:
$. Demo-openrc
Create a "Self-Service" network:
$openstack network create selfservice+-+--+ | Field | Value | +-- -+ | admin_state_up | UP | | availability_zone_hints | | availability_zones | | | created_at | 2016-11-29T09:47:39Z | | description | | headers | | id | eb2f08c3-dbc4-423e-8206-6b0fb07d94b7 | | ipv4_address_scope | None | | | ipv6_address_scope | None | | mtu | 1450 | | name | selfservice | | port_security_enabled | True | Project_id | c7ddc0ecab64419486df0d7f66e8174c | | project_id | c7ddc0ecab64419486df0d7f66e8174c | | revision_number | 3 | router:external | Internal | | shared | False | | status | ACTIVE | | subnets | | tags | [] | | updated_at | 2016-11-29T09:47:39Z | +- -+
Set the "Self-Service" network subnet:
$openstack subnet create-- network selfservice\-- dns-nameserver 114.114.114.114-- gateway 192.168.196.1\-- subnet-range 192.168.196.0 take 24 selfservice+-+--+ | Field | Value | | +-+-+ | allocation_pools | 192.168.196.2-192.168.196.254 | | cidr | 192.168.196.0 hand 24 | | | created_at | 2016-11-28T23:23:23Z | | description | | dns_nameservers | 114.114.114.114 | | enable_dhcp | True | | gateway_ip | 192.168.196.1 | | | headers | | host_routes | id | e7aed07e-0d4c-4b8f-9210-1ec658a92f33 | | ip_version | 4 | | ipv6_address_mode | None | | | ipv6_ra_mode | None | | name | selfservice | | network_id | 18d0b6d3-b78a-4703-a24e-ec5dc9b73bd7 | | project_id | c77f9d27e4f5496092357ff991d1639b | | project_id | c77f9d27e4f5496092357ff991d1639b | | revision_number | 2 | | service_ | Types | [] | subnetpool_id | None | | updated_at | 2016-11-28T23:23:24Z | +-+-+
View the network that has been created:
$openstack subnet list+--+-+--+-+ | ID | | Name | Network | Subnet | +-- +-- -+-+ | b8d66c38-2770-46f0-bbc1-6010b995d5af | provider | 716eaea1-3b1b-459a-a601-4b9a0d3266e3 | 192.168.195.0 931e-402da6441a35 24 | | ee9382f0-3ce2-4451-931e-402da6441a35 | selfservice | eb2f08c3-dbc4-423e-8206-6b0fb07d94b7 | 192.168.196.0 ee9382f0 24 | +-- -+-create and configure routes
Set the test user environment variables:
$. Demo-openrc
Update "Provider" network routes:
$neutron net-update provider-- router:externalUpdated network: provider
Create a route:
$openstack router create router+-+--+ | Field | Value | +-- -+ | admin_state_up | UP | | availability_zone_hints | | availability_zones | | | created_at | 2016-11-29T09:50:56Z | | description | | external_gateway_info | null | | flavor_id | None | | headers | | id | 2b84f7f4-9bef-427f-afad-19a9f53b4b2d | | name | router | | project_id | c7ddc0ecab64419486df0d7f66e8174c | | project_id | c7ddc0ecab64419486df0d7f66e8174c | | revision_number | 2 | | | routes | | status | ACTIVE | | updated_at | 2016-11-29T09:50:56Z | +-- -- +
Add the "Self-Service" network to the routed port:
$neutron router-interface-add router selfserviceAdded interface ba82e6d7-117d-42cd-8c51-adde92aeb14b to router router.# neutron router-interface-delete router selfservice
Set the gateway for the "Provider" network:
$neutron router-gateway-set router providerSet gateway for router router# neutron router-gateway-clear router provider verifies the network service
Set the administrator user environment variable:
$. Admin-openrc
View the network namespace:
$ip netnsqrouter-2b84f7f4-9bef-427f-afad-19a9f53b4b2d (id: 2) qdhcp-eb2f08c3-dbc4-423e-8206-6b0fb07d94b7 (id: 1) qdhcp-716eaea1-3b1b-459a-a601-4b9a0d3266e3 (id: 0)
View routed ports:
$neutron router-port-list router+--+- -+ | id | name | mac_address | fixed_ips | +-- +-- -+-+ | 1b867faf-2602-4a2b-a626-a80be2dbb8a4 | | fa:16:3e:48:b3:dd | {"subnet_id": | | | | "b8d66c38-2770-46f0-bbc1-6010b995d5af" | | ip_address ":" 192.168.195.201 "} | | ba82e6d7-117d-42cd-8c51-adde92aeb14b | | fa:16:3e:19:ac:de | {" subnet_id ":" ee9382f0-3ce2-4451-931e-| | | 402da6441a35 "| "ip_address": "192.168.196.1"} | +-- -+
Test the "Provider" network using the ping command:
$ping-c 4 192.168.195.201PING 192.168.195.201 (192.168.195.201) 56 (84) bytes of data.64 bytes from 192.168.195.201: icmp_seq=1 ttl=64 time=0.131 ms64 bytes from 192.168.195.201: icmp_seq=2 ttl=64 time=0.057 ms64 bytes from 192.168.195.201: icmp_seq=3 ttl=64 time=0.054 ms64 bytes from 192.168.195.201: icmp_seq=4 ttl=64 time=0.051 ms--- 192.168.195.201 ping statistics-4 packets transmitted, 4 received 0% packet loss, time 2997msrtt min/avg/max/mdev = 0.053 ms, create and configure virtual machine templates
Set the administrator user environment variable:
$. Admin-openrc
Create a "m1.nano" virtual machine template:
$openstack flavor create-- id 0-- vcpus 1-- ram 64-- disk 1 m 1. Nanotubes talk about + | Field | Value | +-- +-+ | OS-FLV- DISABLED:disabled | False | | OS-FLV-EXT-DATA:ephemeral | 0 | disk | 1 | id | 0 | name | m1.nano | | os-flavor-access:is_public | True | | properties | | ram | 64 | | rxtx_factor | 1.0 | | swap | vcpus | 1 | +-- +-generate a key pair |
Set the test user environment variables:
$. Demo-openrc
Generate ssh key pair:
# Alternatively, you can skip the ssh-keygen command and use an existing public key.$ ssh-keygen-Q-N "" Enter file in which to save the key (/ root/.ssh/id_rsa):
Add a key pair:
$openstack keypair create-- public-key ~ / .ssh/id_rsa.pub mykey+-+---+ | Field | Value | +- -+-- + | fingerprint | 92:f3:2f:58:fa:6b:32:c7:b2:df:66:46:5f:28:43:d4 | | name | mykey | | user_ Id | ffff52bbf1da4c86a3d2b57e977f6b82 | +-+-+
Check the key pair:
$openstack keypair list+-+---+ | Name | Fingerprint | + -+ | mykey | 92:f3:2f:58:fa:6b:32:c7:b2:df:66:46:5f:28:43:d4 | +-+-+ add security group rules
Allow ICMP protocol (can ping):
$openstack security group rule create-- proto icmp default+-+--+ | Field | Value | +-- -- + | created_at | 2016-11-28T23:33:13Z | | description | | direction | ingress | | ethertype | IPv4 | | headers | | id | 7f5a28ec-2523-4922-aaad-92bd4c1583c5 | | port_range_max | None | | port_range_min | None | | project_id | c7ddc0ecab64419486df0d7f66e8174c | | project_id | | | c7ddc0ecab64419486df0d7f66e8174c | | protocol | icmp | | remote_group_id | None | | remote_ip_prefix | 0.0.0.0amp0 | | revision_number | 1 | | security_group_id | 42794c97Murbdfbmile4f02-| Aa5c-c34df255f620 | | updated_at | 2016-11-28T23:33:13Z | +-+-+
Allow the SSH protocol:
$openstack security group rule create-proto tcp-dst-port 22 default+-+--+ | Field | Value | +- +-- + | created_at | 2016-11-28T23:34:05Z | | description | | direction | ingress | | ethertype | IPv4 | | headers | | id | bfe104f7-e15c-4216-bf12-79c36247a308 | | port_range_max | 22 | port_range_min | 22 | | project_id | c7ddc0ecab64419486df0d7f66e8174c | | | project_id | c7ddc0ecab64419486df0d7f66e8174c | | protocol | tcp | | remote_group_id | None | | remote_ip_prefix | 0.0.0.0and0 | | revision_number | 1 | | security_group_ | Id | 42794c97-bdfb-4f02-aa5c-c34df255f620 | | updated_at | 2016-11-28T23:34:05Z | +-+-- + start the virtual machine on the "Self-Service" network to confirm the virtual machine option
Set the test user environment variables:
$. Demo-openrc
View the virtual machine template that has been created:
$openstack flavor list+----+ | ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public | +-- + -+-+ | 0 | m1.nano | 64 | 1 | 0 | True | +-+
View the virtual machine images that have been added:
$openstack image list+--+ | ID | Name | Status | +-- -e345e8b0-71b7-44e0-b1a1-e168f85a19f6 | cirros | active | +-+
View the virtual machine network that has been created:
$openstack network list+--+-+--+ | ID | Name | Subnets | +-+ | 716eaea1-3b1b-459a-a601-4b9a0d3266e3 | provider | | b8d66c38-2770-46f0-bbc1-6010b995d5af | | eb2f08c3-dbc4-423e-8206-6b0fb07d94b7 | selfservice | ee9382f0-3ce2-4451-931e-402da6441a35 | +-- +-- + |
View the security groups that have been added:
$openstack security group list+--+-+----+--+ | ID | | Name | Description | Project | +-- + -+ | 42794c97-bdfb-4f02-aa5c-c34df255f620 | default | Default security group | c7ddc0ecab64419486df0d7f66e8174c | +-- +-+-- -- + create a virtual machine instance
Create and start the virtual machine:
Openstack server create-- flavor m1.nano-- image cirros\-- nic net-id=eb2f08c3-dbc4-423e-8206-6b0fb07d94b7-- security-group default\-- key-name mykey selfservice-instance+--+-- -+ | Field | Value | +-- -+ | OS-DCF:diskConfig | MANUAL | | OS-EXT-AZ:availability_zone | 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 | RtZAyPrB426N | | config_drive | created | | | 2016-11-29T09:59:42Z | | flavor | m1.nano (0) | | hostId | | id | | | aef838f5-8f9d-4ff2-8a34-17bd5ac05a8a | | image | cirros (e345e8b0-71b7-44e0-b1a1-e168f85a19f6) | | key_name | mykey | | name | selfservice-instance | | | os-extended-volumes:volumes_attached | [] | | progress | 0 | | project_id | c7ddc0ecab64419486df0d7f66e8174c | | properties | | security_groups | [{ublnameplate: upridefault'}] | | status | BUILD | | updated | | | 2016-11-29T09:59:42Z | | user_id | ffff52bbf1da4c86a3d2b57e977f6b82 | +-- -+
View the status of the virtual machine:
$openstack server list+--+--+ | ID | Name | | Status | Networks | Image Name | +-- +-- + | aef838f5-8f9d-4ff2-8a34-17bd5ac05a8a | Selfservice-instance | BUILD | | cirros | +-- +-- + access the virtual machine through the virtual console
If the virtual machine is not started, you can use the following command:
$openstack server start selfservice-instance
View the virtual machine console URL and open it using a Web browser (username: "cirros", password: "cubswin:)":
$openstack console url show selfservice-instance+-+----+ | Field | Value | | +-+-- + | type | novnc | | | url | http://ubuntustack:6080/vnc_auto.html?token=749d78c1-33f1-4843-a5f6-1f0920773941 | + -- +
Reset the virtual machine password:
$sudo passwd root > 123456 > 123456
Ping intranet gateway and public network URL:
$ping-c 4 192.168.196.1$ ping www.163.com remote access virtual machine
Create a floating IP on the "Provider" network:
$openstack floating ip create provider+-+--+ | Field | Value | +-- -- + | created_at | 2016-11-29T10:04:06Z | | description | | fixed_ip_address | None | | floating_ip_address | 192.168. 195.206 | | floating_network_id | 716eaea1-3b1b-459a-a601-4b9a0d3266e3 | | headers | | id | a037740a-eb2a-4b78-9b9a-39a5c1b00ac7 | | port_id | None | | project_id | c7ddc0ecab64419486df0d7f66e8174c | | project_id | | c7ddc0ecab64419486df0d7f66e8174c | | revision_number | 1 | | router_id | None | | status | DOWN | | updated_at | 2016-11-29T10:04:06Z | +-| -+-+ # openstack floating ip delete d30f7916-a9c7-42ee-aaec-f60bb1ae732a
Add a floating IP to the "selfservice-instance" virtual machine you just created:
$openstack server add floating ip selfservice-instance 192.168.195.20 openstack server remove floating ip selfservice-instance 192.168.195.211
View the status of the virtual machine:
$openstack server list+--+--+-+----+ -+ | ID | Name | Status | Networks | Image Name | +-+- -+ | aef838f5-8f9d-4ff2-8a34-17bd5ac05a8a | selfservice-instance | ACTIVE | selfservice=192.168.196.9 192.168.195.206 | cirros | +-- -+
Ping virtual machine floating IP:
$ping-c 4 192.168.195.206PING 192.168.195.206 (192.168.195.206) 56 (84) bytes of data.64 bytes from 192.168.195.206: icmp_seq=1 ttl=63 time=0.955 ms64 bytes from 192.168.195.206: icmp_seq=2 ttl=63 time=0.350 ms64 bytes from 192.168.195.206: icmp_seq=3 ttl=63 time=0.445 ms64 bytes from 192.168.195.206: icmp_seq=4 ttl=63 time=0.711 ms--- 192.168.195.206 ping statistics-4 packets transmitted, 4 received 0% packet loss, time 3003msrtt min/avg/max/mdev = 0.350 ms, 0.615, 0.955, 0.237
Use ssh to access the virtual machine:
$ssh cirros@192.168.195.206$ cat / etc/issue login as' cirros' user. Default password: 'cubswin:). Use 'sudo' for root. Install and configure block storage services
Create a Cinder database:
$mysql-u root-p > openstack > CREATE DATABASE cinder; > GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY' openstack'; > GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY' openstack'; > quit
Set the administrator user environment variable:
$. Admin-openrc creates and configures KeyStore authentication for Cinder
To create a Cinder user:
$openstack user create-domain default-password-prompt cinderUser Password: > openstackRepeat User Password: > openstack+-+--+ | Field | Value | +- -+-+ | domain_id | default | | enabled | True | | id | 16912fdd1eed410a8a76720b0a38a334 | | name | cinder | | password_expires_at | None | +-- + |
Add the Cinder user to the administrator role of the service:
$openstack role add-project service-user cinder admin
To create a Cinder service:
$openstack service create-- name cinder-- description "OpenStack Block Storage" volume+-+--+ | Field | Value | +-- -+ | description | OpenStack Block Storage | | enabled | True | | id | 0b2ccf8379a345748773027492a28c8c | | name | cinder | | type | volume | +-+- -+
Create a Cinder V2 service:
$openstack service create-- name cinderv2-- description "OpenStack Block Storage" volumev2+-+--+ | Field | Value | +-- -+ | description | OpenStack Block Storage | | enabled | True | | id | 4c9f38fec5e7419a96faeb615d9459c6 | | name | cinderv2 | | type | volumev2 | +-+- -+
Create a public EndPoint for the Cinder service:
$openstack endpoint create-- region RegionOne volume public http://ubuntustack:8776/v1/%\(tenant_id\)s+--------------+------------------------------------------+| Field | Value | +- -+-+ | enabled | True | | id | 606c64305e0b49bb968d39aaec25b37a | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 0b2ccf8379a345748773027492a28c8c | | service_name | cinder | | service_type | volume | | url | http://ubuntustack:8776/v1/%(tenant_id)s | +-| -+
Create the internal EndPoint of the Cinder service:
$openstack endpoint create-- region RegionOne volume internal http://ubuntustack:8776/v1/%\(tenant_id\)s+--------------+------------------------------------------+| Field | Value | +- -+-+ | enabled | True | | id | 315ba5dbbb9944abaa9d3bbe391b6b67 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 0b2ccf8379a345748773027492a28c8c | | service_name | cinder | | service_type | volume | | url | http://ubuntustack:8776/v1/%(tenant_id)s | +-| -+-
Create a management EndPoint for the Cinder service:
$openstack endpoint create-- region RegionOne volume admin http://ubuntustack:8776/v1/%\(tenant_id\)s+--------------+------------------------------------------+| Field | Value | +- -+-+ | enabled | True | | id | 7f1c360d846c45f3ba00ab9f1924eda3 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 0b2ccf8379a345748773027492a28c8c | | service_name | cinder | | service_type | volume | | url | http://ubuntustack:8776/v1/%(tenant_id)s | +-| -+
Create a public EndPoint for the Cinder V2 service:
$openstack endpoint create-- region RegionOne volumev2 public http://ubuntustack:8776/v2/%\(tenant_id\)s+--------------+------------------------------------------+| Field | Value | +- -+-+ | enabled | True | | id | b0d39b4917ce440dae198c89313c2034 | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 4c9f38fec5e7419a96faeb615d9459c6 | | service_name | cinderv2 | | service_type | volumev2 | | url | http://ubuntustack:8776/v2/%(tenant_id)s | +-| -+
Create an internal EndPoint for the Cinder V2 service:
$openstack endpoint create-- region RegionOne volumev2 internal http://ubuntustack:8776/v2/%\(tenant_id\)s+--------------+------------------------------------------+| Field | Value | +- -+-+ | enabled | True | | id | 508541b13b1b4d4ebb860891c0ccffbd | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 4c9f38fec5e7419a96faeb615d9459c6 | | service_name | cinderv2 | | service_type | volumev2 | | url | http://ubuntustack:8776/v2/%(tenant_id)s | +-| -+-
Create a management EndPoint for the Cinder V2 service:
$openstack endpoint create-- region RegionOne volumev2 admin http://ubuntustack:8776/v2/%\(tenant_id\)s+--------------+------------------------------------------+| Field | Value | +- -+-+ | enabled | True | | id | 283c9c773a194b61aca19b3cfcdb14a6 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 4c9f38fec5e7419a96faeb615d9459c6 | | service_name | cinderv2 | | service_type | volumev2 | | url | http://ubuntustack:8776/v2/%(tenant_id)s | +-| -+-- + install and configure Cinder services
Install the Cinder package:
$apt-get install cinder-api cinder-scheduler cinder-volume$ vi / etc/cinder/ cinder.confs [database] connection = mysql+pymysql://cinder:openstack@ubuntustack/ cinder [default]... transport_url = rabbit://openstack:openstack@ubuntustackauth_strategy = keystonemy_ip = 192.168.195.160 [Keystone _ authtoken] auth_uri = http://ubuntustack:5000auth_url = http://ubuntustack:35357memcached_servers = ubuntustack:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject _ name = serviceusername = cinderpassword = openstack [Oslo _ concurrency] lock_path = / var/lib/cinder/tmp
Configure Nova to use the Cinder service:
$vi / etc/nova/ Nova. Confs [cinder] os_region_name = RegionOne
Synchronize the Cinder database:
$su-s / bin/sh-c "cinder-manage db sync" cinder
Restart the Nova and Cinder services:
$service nova-api restart & & service cinder-scheduler restart & & service cinder-api restart install and configure LVM support for Cinder
Install the LVM package:
$apt-get install lvm2
Start the LVM metadata service:
$service lvm2-lvmetad start
Create a PV:
$pvcreate / dev/sdd1 Physical volume "/ dev/sdd1" successfully created
Create a VG:
$vgcreate cinder-volumes / dev/sdd1 Volume group "cinder-volumes" successfully created
Configure Cinder to use LVM:
$vi / etc/cinder/ cinder.confs [default]... enabled_backends = lvmglance_api_servers = http://ubuntustack:9292[lvm]volume_driver = cinder.volume.drivers.lvm.LVMVolumeDrivervolume_group = cinder-volumesiscsi_protocol = iscsiiscsi_helper = tgtadm
Restart the Cinder volume service:
$service cinder-volume restart$. Admin-openrc$ openstack volume service list+-+--+ | Binary | Host | Zone | Status | State | Updated At | | +-+-+ | cinder-scheduler | UbuntuStack | nova | enabled | up | 2016-11-29T00 | : 35 enabled 14.000000 | cinder-volume | UbuntuStack | nova | up | 2016-11-29T00:34:33.000000 | | cinder-volume | UbuntuStack@lvm | nova | enabled | up | 2016-11-29T00:35:17.000000 | +-- -+ create a LV volume
Set the test user environment variables:
$. Demo-openrc
Create a 1G volume:
$openstack volume create-- size 1 volume1+-+--+ | Field | Value | +-- -- + | attachments | [] | | availability_zone | nova | | bootable | false | | consistencygroup_id | None | | created_at | 2016-11-29T10:21:46.494577 | | description | None | | encrypted | False | | id | 5e291162-0cbb-4077-bb07-c2a217b28c1e | | multiattach | False | | | name | volume1 | | properties | replication_status | disabled | | size | 1 | | snapshot_id | None | | | source_volid | None | | status | creating | | type | None | | updated_at | None | | user_id | | | ffff52bbf1da4c86a3d2b57e977f6b82 | +-+-- + # openstack volume delete volume1 |
View the volumes that have been created:
$openstack volume list+--+ | ID | Display Name | Status | Size | Attached to | + -- + | 5e291162-0cbb-4077-bb07-c2a217b28c1e | volume1 | creating | 1 | +- -- +
Add a volume to the virtual machine:
$openstack server add volume selfservice-instance volume1
View the status of the virtual machine:
$openstack volume list+--+- -+ | ID | Display Name | Status | Size | Attached to | +-- -+ | 5e291162-0cbb-4077-bb07-c2a217b28c1e | volume1 | in-use | 1 | Attached to selfservice-instance on / dev/vdb | + -+
$View the volumes attached to the virtual machine:
$ssh cirros@192.168.195.206$ sudo fdisk-lDisk / dev/vda: 1073 MB, 1073741824 bytes255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectorsUnits = sectors of 1 * 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000 Device Boot Start End Blocks Id System/dev/vda1 * 16065 2088449 1036192 + 83 LinuxDisk / dev/vdb: 1073 MB, 1073741824 bytes16 heads, 63 sectors/track, 2080 cylinders Total 2097152 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk / dev/vdb doesn't contain a valid partition table installation and configuration dashboard service installation and configuration Horizon service
Install the Horizon package:
$apt install openstack-dashboard
Configure the Horizon service:
$vi / etc/openstack-dashboard/local_settings.py# Configure the dashboard to use OpenStack services on the ubuntustack nodeOPENSTACK_HOST = "ubuntustack" # Allow all hosts to access the dashboardALLOWED_HOSTS = ['*',] # Configure the memcached session storage serviceSESSION_ENGINE = 'django.contrib.sessions.backends.cache'CACHES = {' default': {'BACKEND':' django.core.cache.backends.memcached.MemcachedCache', 'LOCATION':' ubuntustack:11211' }} # Enable the Identity API version 3OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3"% OPENSTACK_HOST# Enable support for domains:OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True# Configure API versions:OPENSTACK_API_VERSIONS = {" identity ": 3," image ": 2," volume ": 2 } # Configure default as the default domain for users that you create via the dashboard:OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "default" # Configure user as the default role for users that you create via the dashboard:OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user" # Optionally, configure the time zone:TIME_ZONE = "Asia/Shanghai"
Restart the Web server:
$service apache2 reload verifies Horizon service
Open http://ubuntustack/horizon using a browser and log in with the following username and password:
Domain User Passworddefault admin openstackdefault demo openstack so far, I believe you have a deeper understanding of "how to install OpenStack on a single node of Ubuntu16". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.