热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

CentOS6.4openstackgrizzly安装配置(openvswitch单节点)

准备环境1、配置yum源CentOS6-Base-163.repo[base]nameCentOS-$releasever-Base-163.combaseurlhttp://mirrors.163.com/centos/$releasever/os/$basearch/#mirrorlisthttp://mirror
准备环境
1、配置yum源
CentOS6-Base-163.repo
[base]
name=CentOS-$releasever - Base - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
epel.repo [epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://centos.ustc.edu.cn/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=http://centos.ustc.edu.cn/epel/6/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=http://centos.ustc.edu.cn/epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0
openstack.repo [openstack]
baseurl=http://rdo.fedorapeople.org/openstack/openstack-grizzly/epel-6
gpgcheck=0

安装前准备
1、 安装OpenStack Utilities #yum install -y openstack-utils dnsmasq-utils
2、更新系统
# yum update
3、关闭iptables

# service iptables stop
# chkconfig iptables off
4.关闭selinux

# vi /etc/selinux/config
SELINUX=disabled
5、重启服务器
# reboot
6、安装qpid # yum install -y qpid-cpp-server
# sed -i -e 's/auth=.*/auth=no/g' /etc/qpidd.conf
# service qpidd start
# chkconfig qpidd on

部署KeyStone
1、安装KeyStone # yum install -y openstack-keystone
2、初始化数据库

# openstack-db --init --service keystone \
        --password PASSWORD
如果没有安装mysql,会在这步安装,这里默认密码PASSWORD 3、生成Token,并设置环境变量

# export SERVICE_TOKEN=$(openssl rand -hex 10)
# export SERVICE_ENDPOINT=http://10.9.0.206:35357/v2.0
# echo $SERVICE_TOKEN > /tmp/ks_admin_token
71068df694f4c4620156
4、修改配置文件

# openstack-config --set /etc/keystone/keystone.conf \
  DEFAULT admin_token $SERVICE_TOKEN
# openstack-config --set /etc/keystone/keystone.conf \
  signing token_format UUID
5、启动keystone服务

# service openstack-keystone start
# chkconfig openstack-keystone on
6、查看是否启动正常
# ps -ef | grep -i keystone-all
keystone  2331     1  3 15:24 ?        00:00:00 /usr/bin/python /usr/bin/keystone-all --config-file /etc/keystone/keystone.conf
root      2339  1902  0 15:24 pts/0    00:00:00 grep -i keystone-all
# grep ERROR /var/log/keystone/keystone.log
7、创建Keystone服务,并注册Endpoint

# keystone service-create --name=keystone --type=identity \
  --description="Keystone Identity Service"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |    Keystone Identity Service     |
|      id     | b987bd18f91a47709d1c191ca924f4db |
|     name    |             keystone             |
|     type    |             identity             |
+-------------+----------------------------------+
# keystone endpoint-create \
  --service_id b987bd18f91a47709d1c191ca924f4db \
  --publicurl 'http://10.9.0.206:5000/v2.0' \
  --adminurl 'http://10.9.0.206:35357/v2.0' \
  --internalurl 'http://10.9.0.206:5000/v2.0'
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |   http://10.9.0.206:35357/v2.0   |
|      id     | a86e402ec8144c0ba560f9b917c65981 |
| internalurl |   http://10.9.0.206:5000/v2.0    |
|  publicurl  |   http://10.9.0.206:5000/v2.0    |
|    region   |            regionOne             |
|  service_id | b987bd18f91a47709d1c191ca924f4db |
+-------------+----------------------------------+
其中service_id和上面创建service的返回ID对应
8、创建admin用户
a) 创建admin用户

# keystone user-create --name admin --pass PASSWORD
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | 8179d4236cd147f2a9670df1616882a0 |
|   name   |              admin               |
| tenantId |                                  |
+----------+----------------------------------+
b) 创建admin role

# keystone role-create --name admin
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | c44c1e8f4b8c4efa82beb83a847dd0ca |
|   name   |              admin               |
+----------+----------------------------------+
c) 创建admin tenant

# keystone tenant-create --name admin
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |                                  |
|   enabled   |               True               |
|      id     | 78b342b561ed4fb79ab764b828473f93 |
|     name    |              admin               |
+-------------+----------------------------------+
d)将admin用户加入到admin role中

# keystone user-role-add --user-id 8179d4236cd147f2a9670df1616882a0 \
  --role-id c44c1e8f4b8c4efa82beb83a847dd0ca \
  --tenant-id 78b342b561ed4fb79ab764b828473f93
e)设置admin的环境变量

# vi keystonerc_admin
export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export OS_PASSWORD=PASSWORD
export OS_AUTH_URL=http://10.9.0.205:35357/v2.0/
export PS1='[\u@\h \W(keystone_admin)]\$ '
f)测试是否创建完成
# unset SERVICE_TOKEN
# unset SERVICE_ENDPOINT
# source ~/keystonerc_admin
# keystone user-list
9、创建一个普通用户
# keystone user-create --name tcommerce --pass PASSWORD
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | ad91d8062e5e48b185aa0e0847d4b860 |
|   name   |            tcommerce             |
| tenantId |                                  |
+----------+----------------------------------+
#  keystone role-create --name user
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | c5689d23e5a04465831f5e39caff1099 |
|   name   |               user               |
+----------+----------------------------------+
# keystone tenant-create --name user
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |                                  |
|   enabled   |               True               |
|      id     | f380922e9d844b77b7c1cb742c7ca04b |
|     name    |               user               |
+-------------+----------------------------------+
keystone user-role-add --user-id ad91d8062e5e48b185aa0e0847d4b860 \
  --role-id c5689d23e5a04465831f5e39caff1099 \
  --tenant-id f380922e9d844b77b7c1cb742c7ca04b
#vim keystonerc_tcommerce
export OS_USERNAME=tcommerce
export OS_TENANT_NAME=user
export OS_PASSWORD=PASSWORD
export OS_AUTH_URL=http://10.9.0.206:5000/v2.0/
export PS1='[\u@\h \W(tcommerce)]\$ '
# source keystonerc_tcommerce
# keystone user-list
Unable to communicate with identity service: {"error": {"message": "You are not authorized to perform the requested action: admin_required", "code": 403, "title": "Not Authorized"}}. (HTTP 403)
# keystone token-get
+-----------+----------------------------------+
|  Property |              Value               |
+-----------+----------------------------------+
|  expires  |       2013-04-25T08:14:28Z       |
|     id    | 1360775bf4504e84881689e6b9b4fff6 |
| tenant_id | f380922e9d844b77b7c1cb742c7ca04b |
|  user_id  | ad91d8062e5e48b185aa0e0847d4b860 |
+-----------+----------------------------------+

部署Glance

1、安装glance
# yum install -y openstack-glance
2、设置环境变量
# source ~/keystonerc_admin
3、初始数据库
# openstack-db --init --service glance \
        --password PASSWORD
4、修改配置文件
# openstack-config --set /etc/glance/glance-api.conf \
   paste_deploy flavor keystone
# openstack-config --set /etc/glance/glance-api.conf \
   keystone_authtoken admin_tenant_name admin
# openstack-config --set /etc/glance/glance-api.conf \
   keystone_authtoken admin_user admin
# openstack-config --set /etc/glance/glance-api.conf \
   keystone_authtoken admin_password PASSWORD
# openstack-config --set /etc/glance/glance-registry.conf \
   paste_deploy flavor keystone
# openstack-config --set /etc/glance/glance-registry.conf \
   keystone_authtoken admin_tenant_name admin
# openstack-config --set /etc/glance/glance-registry.conf \
   keystone_authtoken admin_user admin
# openstack-config --set /etc/glance/glance-registry.conf \
   keystone_authtoken admin_password PASSWORD
5、启动服务
# service openstack-glance-registry start
# service openstack-glance-api start
# chkconfig openstack-glance-registry on
# chkconfig openstack-glance-api on
6、创建服务和Endpoint
# keystone service-create --name=glance --type=image --description="Glance Image Service"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |       Glance Image Service       |
|      id     | c5b9b64a19084d8fbf1230ab200e730b |
|     name    |              glance              |
|     type    |              image               |
+-------------+----------------------------------+
# keystone endpoint-create --service_id c5b9b64a19084d8fbf1230ab200e730b \
  --publicurl http://10.9.0.206:9292 \
  --adminurl http://10.9.0.206:9292 \
  --internalurl http://10.9.0.206:9292
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |      http://10.9.0.206:9292      |
|      id     | 611967c3b2224cba8632e8ebe98bef96 |
| internalurl |      http://10.9.0.206:9292      |
|  publicurl  |      http://10.9.0.206:9292      |
|    region   |            regionOne             |
|  service_id | c5b9b64a19084d8fbf1230ab200e730b |
+-------------+----------------------------------+
7、测试是否安装成功
# source ~/keystonerc_tcommerce
# glance image-list
9、上传镜像到Glance
a)下载镜像

# wget http://berrange.fedorapeople.org/images/2012-11-15/f17-x86_64-openstack-sda.qcow2
b)上传镜像
glance image-create --name "fd" \
        --is-public true \
        --disk-format qcow2 \
        --container-format bare \
        --file f17-x86_64-openstack-sda.qcow2
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 4255a68ec619c25d8e93ae00e514f42f     |
| container_format | bare                                 |
| created_at       | 2013-04-24T08:30:36                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | f1d57318-63f6-4670-a4c0-b97db6fab835 |
| is_public        | True                                 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | fd                                   |
| owner            | f380922e9d844b77b7c1cb742c7ca04b     |
| protected        | False                                |
| size             | 5089761                              |
| status           | active                               |
| updated_at       | 2013-04-24T08:30:36                  |
+------------------+--------------------------------------+
c)查看镜像

# glance image-list
+--------------------------------------+----------+-------------+------------------+---------+--------+
| ID                                   | Name     | Disk Format | Container Format | Size    | Status |
+--------------------------------------+----------+-------------+------------------+---------+--------+
| f1d57318-63f6-4670-a4c0-b97db6fab835 | fd       | qcow2       | bare             | 5089761 | active |
+--------------------------------------+----------+-------------+------------------+---------+--------+

部署Cinder
1、安装Cinder # yum install -y openstack-cinder
2、设置环境变量
# source ~/keystonerc_admin
3、初始化数据库
# openstack-db --init --service cinder \
        --password PASSWORD
4、修改配置文件
# openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
# openstack-config --set /etc/cinder/cinder.conf \
   keystone_authtoken admin_tenant_name admin
# openstack-config --set /etc/cinder/cinder.conf \
   keystone_authtoken admin_user admin
# openstack-config --set /etc/cinder/cinder.conf \
   keystone_authtoken admin_password PASSWORD
5、修改tgt配置文件
grep -q /etc/cinder/volumes /etc/tgt/targets.conf || sed -i '1iinclude /etc/cinder/volumes/*' /etc/tgt/targets.conf
6、启动tgt #service tgtd start
#chkconfig tgtd on
6、创建cinder-volumes
使用一个空闲独立的分区,这里这个分区为/dev/sdb1 # vgcreate cinder-volumes /dev/sdb1
  Volume group "cinder-volumes" successfully created
# vgdisplay cinder-volumes
  --- Volume group ---
  VG Name               cinder-volumes
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.90 TiB
  PE Size               4.00 MiB
  Total PE              498073
  Alloc PE / Size       0 / 0
  Free  PE / Size       498073 / 1.90 TiB
  VG UUID               KpVXij-o9qC-WNOI-BKIw-1VSz-NUEa-2UsYTF
7、 启动服务
# for srv in api scheduler volume ; do \
   sudo service openstack-cinder-$srv start ; \
  done
# for srv in api scheduler volume ; do \
   sudo chkconfig openstack-cinder-$srv on ; \
  done
8、检查是否有报错
# grep -i ERROR /var/log/cinder/*
# grep CRITICAL /var/log/cinder/*
9、创建服务和endpoint
# keystone service-create --name=cinder --type=volume --description="Cinder Volume Service"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |      Cinder Volume Service       |
|      id     | 43f96e5b49464b809388daebbc5c1b2b |
|     name    |              cinder              |
|     type    |              volume              |
+-------------+----------------------------------+
# keystone endpoint-create --service_id 43f96e5b49464b809388daebbc5c1b2b \
  --publicurl "http://10.9.0.206:8776/v1/\$(tenant_id)s" \
  --adminurl "http://10.9.0.206:8776/v1/\$(tenant_id)s" \
  --internalurl "http://10.9.0.206:8776/v1/\$(tenant_id)s"
10、测试是否正常
# source ~/keystonerc_username
# cinder list

部署 Nova
1、安装nova和cinderclient # yum install -y openstack-nova
# yum install -y python-cinderclient
2、初始化数据库
# openstack-db --init --service nova \
        --password PASSWORD
3、修改配置文件
# openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
# openstack-config --set /etc/nova/api-paste.ini \
  filter:authtoken admin_token $(cat /tmp/ks_admin_token)
4、卸载nova-network
# rpm -e openstack-nova-network-2013.1-2.el6.noarch --nodeps
这里面使用Quantum替代
# service messagebus start
# chkconfig messagebus on
# service libvirtd start
# chkconfig libvirtd on
# openstack-config --set /etc/nova/nova.conf DEFAULT \
   volume_api_class nova.volume.cinder.API
# openstack-config --set /etc/nova/nova.conf DEFAULT \
   enabled_apis ec2,osapi_compute,metadata
5、创建服务和Endpoint

# keystone service-create --name=nova --type=compute --description="Nova Compute Service"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |       Nova Compute Service       |
|      id     | dff2746d4d7049fab6e1a96968f6a6ff |
|     name    |               nova               |
|     type    |             compute              |
+-------------+----------------------------------+
# keystone endpoint-create --service_id dff2746d4d7049fab6e1a96968f6a6ff \
  --publicurl "http://10.9.0.206:8774/v1.1/\$(tenant_id)s" \
  --adminurl "http://10.9.0.206:8774/v1.1/\$(tenant_id)s" \
  --internalurl "http://10.9.0.206:8774/v1.1/\$(tenant_id)s"
+-------------+-------------------------------------------+
|   Property  |                   Value                   |
+-------------+-------------------------------------------+
|   adminurl  | http://10.9.0.206:8774/v1.1/$(tenant_id)s |
|      id     |      21cd3644397e4affb79e22ef26a4acb8     |
| internalurl | http://10.9.0.206:8774/v1.1/$(tenant_id)s |
|  publicurl  | http://10.9.0.206:8774/v1.1/$(tenant_id)s |
|    region   |                 regionOne                 |
|  service_id |      dff2746d4d7049fab6e1a96968f6a6ff     |
+-------------+-------------------------------------------+

部署 OpenStack Networking
1、为OpenStack Networking配置Keystone
# source ~/keystonerc_admin
# keystone service-create --name openstack_network --type network \
        --description 'OpenStack Networking Service'
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |   OpenStack Networking Service   |
|      id     | 90d4cf4d89a143dabf5faf2de1f0de48 |
|     name    |        openstack_network         |
|     type    |             network              |
+-------------+----------------------------------+
# keystone endpoint-create --service-id 90d4cf4d89a143dabf5faf2de1f0de48 \
        --publicurl 'http://10.9.0.206:9696/' \
        --adminurl 'http://10.9.0.206:9696/' \
        --internalurl 'http://10.9.0.206:9696/'
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |     http://10.9.0.206:9696/      |
|      id     | e6b17c6f8ff14455a755e4c9f6fc8ca6 |
| internalurl |     http://10.9.0.206:9696/      |
|  publicurl  |     http://10.9.0.206:9696/      |
|    region   |            regionOne             |
|  service_id | 90d4cf4d89a143dabf5faf2de1f0de48 |
+-------------+----------------------------------+
2、安装 quantum 和插件
# yum install openstack-quantum
# yum install openstack-quantum-openvswitch
3、配置Openstack-Networking
# openstack-config --set /etc/quantum/quantum.conf \
DEFAULT rpc_backend quantum.openstack.common.rpc.impl_qpid
# openstack-config --set /etc/quantum/quantum.conf \
DEFAULT qpid_hostname 10.9.0.206
# openstack-config --set /etc/quantum/quantum.conf \
       keystone_authtoken admin_tenant_name admin
# openstack-config --set /etc/quantum/quantum.conf \
       keystone_authtoken admin_user admin
# openstack-config --set /etc/quantum/quantum.conf \
       keystone_authtoken admin_password PASSWORD
# sudo sh -c 'echo 127.0.0.1 `hostname` >> /etc/hosts'
# quantum-server-setup --plugin openvswitch
Quantum plugin: openvswitch
Plugin: openvswitch => Database: ovs_quantum
Please enter the password for the 'root' MySQL user:
Verified connectivity to MySQL.
Would you like to update the nova configuration files? (y/n):
Y
Configuration updates complete!
# service quantum-server start
# chkconfig quantum-server on
4、修改nova.conf
network_api_class = nova.network.quantumv2.api.API
quantum_admin_username = admin
quantum_admin_password = PASSWORD
quantum_admin_auth_url = http://10.9.0.206:35357/v2.0/
quantum_auth_strategy = keystone
quantum_admin_tenant_name = admin
quantum_url = http://10.9.0.206:9696/
libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
libvirt_use_virtio_for_bridges=True
5、安装OpenStack Networking Agents
# yum install -y openstack-quantum-openvswitch
# quantum-node-setup --plugin openvswitch
Quantum plugin: openvswitch
Please enter the Quantum hostname:
10.9.0.206
Would you like to update the nova configuration files? (y/n):
y
/usr/bin/openstack-config --set|--del config_file section [parameter] [value]
Configuration updates complete!
# service openvswitch start
# chkconfig openvswitch on
# service quantum-openvswitch-agent start
# chkconfig quantum-openvswitch-agent on
# chkconfig quantum-ovs-cleanup on
6、安装 OpenStack Networking DHCP Agent #  quantum-dhcp-setup --plugin openvswitch
Quantum plugin: openvswitch
Please enter the Quantum hostname:
10.9.0.206
Configuration updates complete!
# service quantum-dhcp-agent start
# chkconfig quantum-dhcp-agent on
7、安装OpenStack Networking L3 Agent
# ovs-vsctl add-br br-int
# ovs-vsctl add-br br-ex
# ovs-vsctl add-port br-ex eth1
# yum install -y openstack-quantum
# quantum-l3-setup --plugin openvswitch
Quantum plugin: openvswitch
Please enter the Quantum hostname:
10.9.0.206
Configuration updates complete!
# quantum router-create router1
+-----------------------+--------------------------------------+
| Field                 | Value                                |
+-----------------------+--------------------------------------+
| admin_state_up        | True                                 |
| external_gateway_info |                                      |
| id                    | e6216a61-0212-4b0c-8b1c-3911e9b97974 |
| name                  | router1                              |
| status                | ACTIVE                               |
| tenant_id             | 78b342b561ed4fb79ab764b828473f93     |
+-----------------------+--------------------------------------+
# vi /etc/quantum/l3_agent.ini
router_id = 3129097f-4d02-4610-b77a-47dc7a2904ea
# service quantum-l3-agent start
# chkconfig quantum-l3-agent on
8、启动nova

# service openstack-nova-api start
# service openstack-nova-cert start
# service openstack-nova-conductor start
# service openstack-nova-objectstore start
# service openstack-nova-scheduler start
# service openstack-nova-compute start
# chkconfig openstack-nova-api on
# chkconfig openstack-nova-cert on
# chkconfig openstack-nova-conductor on
# chkconfig openstack-nova-objectstore on
# chkconfig openstack-nova-scheduler on
# chkconfig openstack-nova-compute on

安装Horizon
yum install -y openstack-dashboard
yum install -y mod_ssl
#keystone role-create --name Member
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | 60b56c45151841018131c14f98052a08 |
|   name   |              Member              |
+----------+----------------------------------+
#service httpd start
#chkconfig httpd on
连接https://10.9.0.206/dashboard/
用户名:admin
密码:PASSWORD

Console Access
yum install -y openstack-nova-novncproxy
openstack-config --set /etc/nova/nova.conf \
DEFAULT novncproxy_host 0.0.0.0
openstack-config --set /etc/nova/nova.conf \
DEFAULT novncproxy_port 6080
openstack-config --set /etc/nova/nova.conf \
DEFAULT novncproxy_base_url http://10.9.0.206:6080/vnc_auto.html
openstack-config --set /etc/nova/nova.conf \
DEFAULT vnc_enabled true
openstack-config --set /etc/nova/nova.conf \
DEFAULT vncserver_listen 127.0.0.1
openstack-config --set /etc/nova/nova.conf \
DEFAULT vncserver_proxyclient_address 127.0.0.1
service openstack-nova-novncproxy start
service openstack-nova-consoleauth start
chkconfig openstack-nova-novncproxy on
chkconfig openstack-nova-consoleauth on
service openstack-nova-compute restart

使用OpenStack
1、创建key
# nova keypair-add oskey > oskey.priv
# chmod 600 oskey.priv
2、创建Instance
#  nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| ID | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| 1  | m1.tiny   | 512       | 0    | 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      | {}          |
| 5  | m1.xlarge | 16384     | 160  | 0         |      | 8     | 1.0         | True      | {}          |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
# nova image-list
+--------------------------------------+------+--------+--------+
| ID                                   | Name | Status | Server |
+--------------------------------------+------+--------+--------+
| f1d57318-63f6-4670-a4c0-b97db6fab835 | fd   | ACTIVE |        |
+--------------------------------------+------+--------+--------+
# nova boot --flavor 2 --key_name oskey --image f1d57318-63f6-4670-a4c0-b97db6fab835 fedoral
+-------------------------------------+--------------------------------------+
| Property                            | Value                                |
+-------------------------------------+--------------------------------------+
| OS-EXT-STS:task_state               | scheduling                           |
| image                               | fd                                   |
| OS-EXT-STS:vm_state                 | building                             |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000006                    |
| flavor                              | m1.small                             |
| id                                  | 6169db0a-4e70-4fea-9bd3-80f33875215d |
| security_groups                     | [{u'name': u'default'}]              |
| user_id                             | 8179d4236cd147f2a9670df1616882a0     |
| OS-DCF:diskConfig                   | MANUAL                               |
| accessIPv4                          |                                      |
| accessIPv6                          |                                      |
| progress                            | 0                                    |
| OS-EXT-STS:power_state              | 0                                    |
| OS-EXT-AZ:availability_zone         | None                                 |
| config_drive                        |                                      |
| status                              | BUILD                                |
| updated                             | 2013-04-25T05:01:05Z                 |
| hostId                              |                                      |
| OS-EXT-SRV-ATTR:host                | None                                 |
| key_name                            | oskey                                |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                 |
| name                                | fedoral                              |
| adminPass      &nb
推荐阅读
  • 本文详细介绍了在 CentOS 7 系统中安装 Python 3.7 的步骤,包括编译工具的安装、Python 3.7 源码的下载与编译、软链接的创建以及常见错误的处理方法。 ... [详细]
  • CentOS下ProFTPD的安装与配置指南
    本文详细介绍在CentOS操作系统上安装和配置ProFTPD服务的方法,包括基本配置、安全设置及高级功能的启用。 ... [详细]
  • JUnit下的测试和suite
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • Requests库的基本使用方法
    本文介绍了Python中Requests库的基础用法,包括如何安装、GET和POST请求的实现、如何处理Cookies和Headers,以及如何解析JSON响应。相比urllib库,Requests库提供了更为简洁高效的接口来处理HTTP请求。 ... [详细]
  • 调试利器SSH隧道
    在开发微信公众号或小程序的时候,由于微信平台规则的限制,部分接口需要通过线上域名才能正常访问。但我们一般都会在本地开发,因为这能快速的看到 ... [详细]
  • Markdown 编辑技巧详解
    本文介绍如何使用 Typora 编辑器高效编写 Markdown 文档,包括代码块的插入方法等实用技巧。Typora 官方网站:https://www.typora.io/ 学习资源:https://www.markdown.xyz/ ... [详细]
  • 在OpenCV 3.1.0中实现SIFT与SURF特征检测
    本文介绍如何在OpenCV 3.1.0版本中通过Python 2.7环境使用SIFT和SURF算法进行图像特征点检测。由于这些高级功能在OpenCV 3.0.0及更高版本中被移至额外的contrib模块,因此需要特别处理才能正常使用。 ... [详细]
  • Jupyter Notebook多语言环境搭建指南
    本文详细介绍了如何在Linux环境下为Jupyter Notebook配置Python、Python3、R及Go四种编程语言的环境,包括必要的软件安装和配置步骤。 ... [详细]
  • 本文详细介绍了在Linux操作系统上安装和部署MySQL数据库的过程,包括必要的环境准备、安装步骤、配置优化及安全设置等内容。 ... [详细]
  • 本文介绍了一种方法,通过使用Python的ctypes库来调用C++代码。具体实例为实现一个简单的加法器,并详细说明了从编写C++代码到编译及最终在Python中调用的全过程。 ... [详细]
  • 本文详细介绍了如何在ARM架构的目标设备上部署SSH服务端,包括必要的软件包下载、交叉编译过程以及最终的服务配置与测试。适合嵌入式开发人员和系统集成工程师参考。 ... [详细]
  • 本文介绍了Linux操作系统的核心组成部分——内核及其版本分类,以及市面上常见的几种Linux发行版,旨在为初学者提供一个清晰的学习路径。 ... [详细]
  • 如何在Mozilla Firefox中调整GIF动画的循环次数
    本文介绍了如何通过调整Mozilla Firefox的高级设置来控制GIF动画的播放次数,帮助用户根据个人喜好自定义浏览体验。 ... [详细]
  • 在编程实践中,正确管理和释放资源是非常重要的。本文将探讨 Python 中的 'with' 关键字及其背后的上下文管理器机制,以及它们如何帮助我们更安全、高效地管理资源。 ... [详细]
  • MySQL中批量删除特定前缀表的方法
    在MySQL数据库管理中,有时需要批量删除具有相同前缀的表。由于MySQL本身并未提供直接支持此操作的工具,因此需要利用SQL查询来构造DROP TABLE语句,以实现这一需求。 ... [详细]
author-avatar
手机用户2602886967
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有