虚拟机创建流程图:(此图为M版之前的,第9部应取消,compute不能直接访问数据库,需要借助conductor获取数据库数据)
理解流程:
一、客户端与Openstack交互:
1、api或者cli到keystone申请token; 2、api或者cli拿着token到nova-api提交虚机相关参数; 3、nova-api验证token是否合法; 4、nova-api与数据库交互(把拿到的参数存放到数据库);
二、nova-api与各组件的交互:(消息队列)
5、API把消息放到队列; 6、scheduler读取队列消息进行调度(根据过滤、权重),并把相关消息放到队列指定频道; 7、scheduler把相关信息数据存放数据库; 8、调度计算后指定的compute从消息队列获取指令等信息,并返回调用conductor指令放到队列相关的频道; 10、conductor从队列获取指令等信息; 11、conductor从数据库获取创建虚机相关参数,处理消息放到队列传递给compute;
三、nova-compute获取相关资源:
12、compute获得conductor传递的参数等,访问glance获取镜像;13、glance通过keystone验证token,合法后返回指定镜像给compute;
14、compute访问neutron获取网络接口(子网已建立好); 15、neutron通过keystone验证token,合法后返回指定子网的端口给compute;
16、若虚机需要额外磁盘,compute访问cinder获取磁盘; 15、cinder通过keystone验证token,合法后返回指定卷给compute;
四、nova-compute调用相应API创建虚机:
这里nova-compute调用libvirt等创建kvm虚拟机;
nova-api会不停的异步轮训访问数据库,检查虚机状态
下载阿里云镜像:
rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
安装openstack仓库:(M版)
yum -y install centos-release-openstack-mitaka
安装openstack客户端:
yum -y install python-openstackclient
安装openstack的selinux管理包:
yum -y install openstack-selinux
安装数据库:(mariadb)
yum -y install mariadb mariadb-server python2-PyMySQL
编辑数据库:
cd /etc/my.cnf.d/
vim openstack.cnf
[mysqld]
bind-address = 192.168.56.14
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
View Code 启动:
systemctl enable mariadb
systemctl start mariadb
运行安全性脚本:
mysql_secure_installation
创建数据库:
mysql -uroot -p123
创建keystone数据库,并授权:
create database keystone;
grant all on keystone.* to 'keystone'@'localhost' identified by 'keystone';
grant all on keystone.* to 'keystone'@'%' identified by 'keystone';
创建glance数据库,并授权:
create database glance;
grant all on glance.* to 'glance'@'%' identified by 'glance';
grant all on glance.* to 'glance'@'localhost' identified by 'glance';
创建nova数据库,并授权:
create database nova;
grant all on nova.* to 'nova'@'localhost' identified by 'nova';
grant all on nova.* to 'nova'@'%' identified by 'nova';
创建nova_api数据库,并授权:
create database nova_api;
grant all on nova_api.* to 'nova'@'%' identified by 'nova';
grant all on nova_api.* to 'nova'@'localhost' identified by 'nova';
创建neutron数据库,并授权:
create database neutron;
grant all on neutron.* to 'neutron'@'localhost' identified by 'neutron';
grant all on neutron.* to 'neutron'@'%' identified by 'neutron';
创建neutron数据库,并授权:
View Code 安装Rabbitmq:
yum -y install rabbitmq-server
启动:
systemctl enable rabbitmq-server
systemctl start rabbitmq-server
端口:
tcp6 0 0 :::5672 :::* LISTEN 3531/beam
添加rabbitmq的用户并设置密码:
rabbitmqctl add_user openstack openstack
为该用户授权:
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
查看rabbitmq包含的插件:
rabbitmq-plugins list
启用插件:
rabbitmq-plugins enable rabbitmq_management
该插件端口:
tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 3531/beam
配置keystone:(作用:用户认证,服务目录)
用户认证:User,Project,Token,Role
服务目录:Service,Endpoint(具有三中权限:public,private和admin)
安装软件包:
yum -y install openstack-keystone httpd mod_wsgi memcached python-memcached
配置:
使用openssl生成随机值:
openssl rand -hex 10
16572ad955c1cfde9aae
初始环境没用用户进行验证时,使用admin_token就可以验证了
vim /etc/keystone/keystone.conf
配置token:
[DEFAULT]
admin_token = 16572ad955c1cfde9aae
配置数据库:
[database]
connection = mysql+pymysql://keystone:keystone@192.168.56.14/keystone
配置token:
[token]
provider = fernet
driver = memcache
配置memcache:
[memcache]
servers = 192.168.56.14:11211
查看配置:
grep '^[a-z]' /etc/keystone/keystone.conf
同步数据库:(使用keystone去同步)
su -s /bin/sh -c "keystone-manage db_sync" keystone
ll /var/log/keystone/
-rw-r--r-- 1 keystone keystone 4340 Dec 12 17:51 keystone.log
检查数据库是否同步成功:
mysql -h 192.168.56.14 -ukeystone -pkeystone -e "use keystone;show tables;"
创建证书:
keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
查看证书:
ll /etc/keystone
drwx------ 2 keystone keystone 22 Dec 12 17:55 fernet-keys
启动memcache:
systemctl start memcached
systemctl enable memcached
查找memcached配置文件
ps aux | grep memcached
rpm -ql memcached
vim /etc/sysconfig/memcached
启动keystone:
keystone需要mod_wsgi启动:(这里httpd)
编辑httpd配置文件:
vim /etc/httpd/conf/httpd.conf
ServerName 192.168.56.14:80
新建wsgi文件:
vim /etc/httpd/conf.d/wsgi-keystone.conf
Listen 5000
Listen 35357
<VirtualHost *:5000>
WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-public
WSGIScriptAlias / /usr/bin/keystone-wsgi-public
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
ErrorLogFormat "%{cu}t %M"
ErrorLog /var/log/httpd/keystone-error.log
CustomLog /var/log/httpd/keystone-access.log combined
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:35357>
WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
WSGIProcessGroup keystone-admin
WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
ErrorLogFormat "%{cu}t %M"
ErrorLog /var/log/httpd/keystone-error.log
CustomLog /var/log/httpd/keystone-access.log combined
<Directory /usr/bin>
Require all granted
</Directory>
</VirtualHost>
View Code keystone的public端口:5000
keystone的admin端口:35357
启动httpd:
systemctl enable httpd
systemctl start httpd
权限管理:
先连接到keystone:(初次没有用户名和密码,只能使用token)
连接方式两种:1、命令+参数;2、设置环境变量(此次实验使用的方式)
环境变量:1、admin_token:export OS_TOKEN=16572ad955c1cfde9aae
2、连接keystone的URL:export OS_URL=http://192.168.56.14:35357/v3 #(35357:admin的端口;V3是版本)
3、配置API的版本:export OS_IDENTITY_API_VERSION=3
配置用户认证:
创建域:
openstack domain create --description "Default Doamin" default
为这个域创建项目:(admin管理项目)
openstack project create --domain default \
> --description "Admin Project" admin
为这个域创建admin用户:
openstack user create --domain default \
> --password-prompt admin
创建admin角色:(只能创建openstack已定义好的角色,或者编辑配置文件/etc/keystone/policy.json )
openstack role create admin
为admin项目的admin用户授予admin角色:
openstack role add --project admin --user admin admin
创建一个演示的项目:(也是为default域)
openstack project create --domain default \
> --description "Demo Project" demo
创建演示用户:
openstack user create --domain default \
> --password-prompt demo
创建演示角色;
openstack role create user
为demo项目的demo用户授予user角色:
openstack role add --project demo --user demo user
查看,验证是否创建成功:
openstack domain list
创建service项目:
openstack project create --domain default \
> --description "Service Project" service
为每个服务创建连接keystone用户并service项目的各个用户授予角色:
Glance:
openstack user create --domain default --password-prompt glance
openstack role add --project service --user glance admin
Nova:
openstack user create --domain default --password-prompt nova
openstack role add --project service --user nova admin
Neutron:
openstack user create --domain default --password-prompt neutron
openstack role add --project service --user neutron admin
注册服务:
创建服务实例:(identity类型标识)
openstack service create \
> --name keystone --description "Openstack Identity" identity
创建Endpoint:(三种:public,internal,admin)
openstack endpoint create --region RegionOne \
> identity public http://192.168.56.14:5000/v3
openstack endpoint create --region RegionOne \
> identity internal http://192.168.56.14:5000/v3
openstack endpoint create --region RegionOne \
> identity admin http://192.168.56.14:35357/v3
验证:
openstack endpoint list
验证keystone的权限管理:
去掉之前环境变量:
unset OS_TOKEN OS_URL
使用admin用户获取token:
openstack --os-auth-url http://192.168.56.14:35357/v3 \
> --os-project-domain-name default --os-user-domain-name default \
> --os-project-name admin --os-username admin token issue
新建环境变量的脚本:
vim admin-openstack.sh
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_AUTH_URL=http://192.168.56.14:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
View Code vim demo-openstack.sh
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=demo
export OS_AUTH_URL=http://192.168.56.14:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
View Code 验证脚本是否成功:
source /opt/admin-openstack.sh
openstack token issue
配置Glance:(不需要消息队列)
安装软件包:
yum -y install openstack-glance
glance-api:接受云镜像的创建、删除和读取请求;端口:9292
glance-registry:云系统的镜像注册服务;端口:9191
image-store:镜像存储,glance从这个借口获取镜像,存储位置:/var/lib/glance/images
配置glance-api:
vim /etc/glance/glance-api.conf
[database]
connection = mysql+pymysql://glance:glance@192.168.56.14/glance
[keystone_authtoken]
auth_uri = http://192.168.56.14:5000
auth_url = http://192.168.56.14:35357
memcached_servers = 192.168.56.14:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images
View Code 配置glance-registry
vim /etc/glance/glance-registry.conf
[database]
connection = mysql+pymysql://glance:glance@192.168.56.14/glance
[keystone_authtoken]
auth_uri = http://192.168.56.14:5000
auth_url = http://192.168.56.14:35357
memcached_servers = 192.168.56.14:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
View Code 同步数据库,创建表:
su -s /bin/sh -c "glance-manage db_sync" glance
验证创建是否成功:
mysql -h 192.168.56.14 -uglance -pglance -e "use glance;show tables;"
启动服务:
systemctl enable openstack-glance-api
systemctl enable openstack-glance-registry
systemctl start openstack-glance-api
systemctl start openstack-glance-registry
在keystone上做服务注册:
source /opt/admin-openstack.sh
openstack service create --name glance \
> --description "Openstack Image" image
openstack endpoint create --region RegionOne \
> image public http://192.168.56.14:9292
openstack endpoint create --region RegionOne \
> image internal http://192.168.56.14:9292
openstack endpoint create --region RegionOne \
> image admin http://192.168.56.14:9292
验证执行是否成功:
openstack image list 或者 glance image-list 列表为空是正常
上传小镜像:
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
openstack image create "cirros" --file /opt/cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public
再执行上述验证操作:列表中有了这个镜像表示成功
安装配置计算服务:(Nova)
Nova控制节点六组件:API:接收和响应外部请求(还支持EC2 API);Cert:身份认证EC2(亚马逊EC2);ConsoleAuth:控制台的授权验证;
Conductor:计算节点访问数据的中间件;Scheduler:云主机调度;NoVNCproxy:VNC代理(可以web上操作转到VNC接口)
Nova Scheduler:Nova核心组件:决策虚拟机创建在哪个计算节点上(决策步骤:1、过滤-Filter;2、计算权值-Weight)
安装软件包:
yum install openstack-nova-api openstack-nova-conductor \
openstack-nova-console openstack-nova-novncproxy \
openstack-nova-scheduler
修改控制节点配置:
vim /etc/nova/nova.conf
[database]
connection=mysql+pymysql://nova:nova@192.168.56.14/nova
[api_database]
connection=mysql+pymysql://nova:nova@192.168.56.14/nova_api
[keystone_authtoken]
auth_uri = http://192.168.56.14:5000
auth_url = http://192.168.56.14:35357
memcached_servers = 192.168.56.14:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[DEFAULT]
auth_strategy=keystone
rpc_backend=rabbit
enabled_apis=osapi_compute,metadata
use_neutron=True
firewall_driver=nova.virt.firewall.NoopFirewallDriver
[oslo_messaging_rabbit]
rabbit_host=192.168.56.14
rabbit_userid=openstack
rabbit_password=openstack
View Code 在配置文件追加vnc,glance,锁文件配置
[vnc]
vncserver_listen=192.168.56.14
vncserver_proxyclient_address=192.168.56.14
[glance]
api_servers=http://192.168.56.14:9292
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
同步数据库:
su -s /bin/sh -c "nova-manage api_db sync" nova
su -s /bin/sh -c "nova-manage db sync" nova
验证:
mysql -unova -pnova -e "use nova;show tables;"
mysql -unova -pnova -e "use nova_api;show tables;"
启动Nova各个服务:
systemctl enable openstack-nova-api openstack-nova-consoleauth openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy
systemctl start openstack-nova-api openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy openstack-nova-consoleauth
在keystone注册:
source /opt/admin-openstack.sh
openstack service create --name nova \
> --description "Openstack Compute" compute
openstack endpoint create --region RegionOne compute admin http://192.168.56.14:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region RegionOne compute internal http://192.168.56.14:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region RegionOne \
> compute public http://192.168.56.14:8774/v2.1/%\(tenant_id\)s
nova-api端口:8774
novncproxy端口:6080
查看执行是否成功:
openstack host list
安装配置Nova计算节点:
基础环境安装:
下载阿里云镜像:
rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
安装openstack仓库:(M版)
yum -y install centos-release-openstacl-mitaka
安装openstack客户端:
yum -y install python-openstackclient
安装openstack的selinux管理包:
yum -y install openstack-selinux
安装Openstack的nova-compute软件包:
yum install openstack-nova-compute
配置Nova:
vim /etc/nova/nova.conf
[DEFAULT]
enabled_apis=osapi_compute,metadata
auth_strategy=keystone
firewall_driver=nova.virt.firewall.NoopFirewallDriver
use_neutron=True
rpc_backend=rabbit
[keystone_authtoken]
api_servers=http://192.168.56.14:9292
auth_uri = http://192.168.56.14:5000
auth_url = http://192.168.56.14:35357
memcached_servers = 192.168.56.14:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[libvirt]
virt_type=kvm
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
[oslo_messaging_rabbit]
rabbit_host=192.168.56.14
rabbit_userid=openstack
rabbit_password=openstack
[vnc]
novncproxy_base_url=http://192.168.56.14:6080/vnc_auto.html
enabled=true
vncserver_listen=0.0.0.0
vncserver_proxyclient_address=192.168.56.15
View Code 启动服务:
systemctl enable libvirtd openstack-nova-compute
systemctl start libvirtd openstack-nova-compute
验证:在控制节点
source /opt/admin-openstack.sh
openstack host list
| Openstack-M-Compute | compute | nova | #表示正常
或者nova service-list
Neutron控制节点安装配置:
安装软件包:
yum -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables
编辑配置:
vim /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins =
auth_strategy = keystone
rpc_backend = rabbit
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true
[database]
connection = mysql+pymysql://neutron:neutron@192.168.56.14/neutron
[keystone_authtoken]
auth_uri = http://192.168.56.14:5000
auth_url = http://192.168.56.14:35357
memcached_servers = 192.168.56.14:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron
[oslo_messaging_rabbit]
rabbit_host = 192.168.56.14
rabbit_userid = openstack
rabbit_password = openstack
[nova]
auth_url = http://192.168.56.14:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = nova
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
View Code vim /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,gre,vxlan,geneve
tenant_network_types =
mechanism_drivers = linuxbridge
extension_drivers = port_security
[ml2_type_flat]
flat_networks = public
[securitygroup]
enable_ipset = true
View Code vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = public:eth0
[vxlan]
enable_vxlan = false
[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_security_group = true
View Code vim /etc/neutron/dhcp_agent.ini
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
vim /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_ip = 192.168.56.14
metadata_proxy_shared_secret = 123qwe
vim /etc/nova/nova.conf
[neutron]
url = http://192.168.56.14:9696
auth_url = http://192.168.56.14:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
service_metadata_proxy=true
metadata_proxy_shared_secret = 123qwe
View Code 为启动neutron脚本创建软连接:
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
同步数据库:
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
启动步骤:
systemctl restart openstack-nova-api.service
systemctl enable neutron-server.service \
> neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
> neutron-metadata-agent.service
systemctl start neutron-server.service \
> neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
> neutron-metadata-agent.service
Neutron-server端口:9696
在keystone注册neutron:
openstack service create --name neutron \
> --description "Openstack Networking" network
openstack endpoint create --region RegionOne \
> network public http://192.168.56.14:9696
openstack endpoint create --region RegionOne network internal http://192.168.56.14:9696
openstack endpoint create --region RegionOne network admin http://192.168.56.14:9696
验证:
neutron agent-list
Neutron计算节点安装配置:
安装软件包:
yum install openstack-neutron-linuxbridge ebtables ipset
配置:
vim /etc/neutron/neutron.conf
[DEFAULT]
auth_strategy = keystone
rpc_backend = rabbit
[keystone_authtoken]
auth_uri = http://192.168.56.14:5000
auth_url = http://192.168.56.14:35357
memcached_servers = 192.168.56.14:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
[oslo_messaging_rabbit]
rabbit_host = 192.168.56.14
rabbit_userid = openstack
rabbit_password = openstack
View Code vim /etc/nova/nova.conf
[neutron]
url = http://192.168.56.14:9696
auth_url = http://192.168.56.14:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
View Code vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = public:eth0
[vxlan]
enable_vxlan = false
[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_security_group = true
启动:
systemctl restart openstack-nova-compute.service
systemctl enable neutron-linuxbridge-agent.service
systemctl start neutron-linuxbridge-agent.service
验证:
到控制节点查看:
neutron agent-list
| 5b49c69d- | Linux bridge | Openstack-M-Co | | :-) | True | neutron- |
| ae95-4420 | agent | mpute | | | | linuxbridge-agent |
创建云主机:(启动虚拟机方式:1、CLI,2、API,3、DASHBOARD)
创建提供者网络:
source /opt/admin-openstack.sh
neutron net-create --shared --provider:physical_network public --provider:network_type flat public-net
验证网络是否创建:
neutron net-list
| 21509156-d53d-4b29-a129-a1b66b266aa3 | public-net | |
创建子网:
neutron subnet-create --name public-subnet --allocation-pool start=192.168.56.100,end=192.168.56.200 --dns-nameserver 223.5.5.5 --gateway 192.168.56.2 public-net 192.168.56.0/24
验证:
neutron net-list
| 21509156-d53d- | public-net | 8e187dd3-4707-4bbc-a266-6ba |
| 4b29-a129-a1b66b266aa3 | | d17e26af4 192.168.56.0/24 |
或者neutron subnet-list
创建虚拟主机规格:
openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano
查看可以创建虚拟机规格:
openstack flavor list
创建密钥对:
source /opt/demo-openstack.sh
生成密钥对:
ssh-keygen -q -N ""
在openstack上创建秘钥:
openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey
查看:
openstack keypair list
增加安全组允许Ping:
openstack security group rule create --proto icmp default
增加安全组允许Ssh:
openstack security group rule create --proto tcp --dst-port 22 default
创建实例:
source /opt/demo-openstack.sh
列出可用的网络,创建虚机时需要使用网络ID:
openstack network list
| 21509156-d53d-4b29-a129-a1b66b266aa3 | public-net | 8e187dd3-4707-4bbc-a266-6bad17e26af4 |
openstack server create --flavor mi.nano --image cirros \
> --nic net-id=21509156-d53d-4b29-a129-a1b66b266aa3 --security-group default \
> --key-name mykey my-test-virt
查看验证:
openstack server list
| aff27162-86f2-4488-97cd-2eb25131cf95 | my-test-virt | ACTIVE | public-net=192.168.56.101 |
重置虚机状态:
nova reset-state(reset-network ) server_ID
获取控制台novnc地址:
openstack console url show my-test-virt
| type | novnc |
| url | http://192.168.56.14:6080/vnc_auto.html?token=d2c4ce2f-8ee2-49ae-a3cc-34eac355c029 |
物理机为虚机开放VNC端口从5900开始,访问管理节点的6080会跳转到虚机所在物理对应开放的端口(lsof -i:5900 -n)
安装Dashboard:
安装软件包:
yum install openstack-dashboard -y
配置:
vim /etc/openstack-dashboard/local_setting
ALLOWED_HOSTS = ['*', ]
OPENSTACK_API_VERSIONS = {
# "data-processing": 1.1,
"identity": 3,
"volume": 2,
"compute": 2,
}
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'default'
OPENSTACK_HOST = "192.168.56.14"
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3.0" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
OPENSTACK_NEUTRON_NETWORK = {
'enable_router': False,
'enable_quotas': False,
'enable_ipv6': False,
'enable_distributed_router': False,
'enable_ha_router': False,
'enable_lb': False,
'enable_firewall': False,
'enable_vpn': False,
'enable_fip_topology_check': False,
View Code 启动:
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com