|
1,准备一台服务器,安装ubuntu12.04系统,用于controller的部署。
2,compute节点需准备好一个cinder-volumes 的VG。
3,各节点网卡设置(eth0分配静态地址,用于public和internal网络,eth1手动但不分配地址,用于private网络):
$ /etc/network/interfaces
auto eth1
iface eth1 inetmanual
up ifconfig eth1up
4,添加ubuntu cloud源
$ /etc/network/interfaces
auto eth1
iface eth1 inetmanual
up ifconfig eth1up
5,添加puppet源
$ wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb
$ sudodpkg –i puppetlabs-release-precise.deb 6,更新系统
7,添加puppet别名到/etc/hosts
8,安装puppet和puppet模块
$ sudo apt-get install puppet puppetmaster
$ sudo puppet module install puppetlabs/openstack 9,vi /etc/puppet/manifests/site.pp:
#
# This document serves as an example of how to deploy
# basic single and multi-node openstack environments.
#
# deploy a script that can be used to test nova
class { 'openstack::test_file': }
####### shared variables ##################
# this section is used to specify global variables thatwill
# be used in the deployment of multi and single nodeopenstack
# environments
# assumes that eth0 is the public interface
$public_interface = 'eth0'
# assumes that eth1 is the interface that will be usedfor the vm network
# this configuration assumes this interface is active butdoes not have an
# ip address allocated to it.
$private_interface = 'eth1'
# credentials
$admin_email = 'root@localhost'
$admin_password = 'keystone_admin'
$cinder_user_password = 'cinder_pass'
$cinder_db_password = 'cinder_pass'
$keystone_db_password = 'keystone_db_pass'
$keystone_admin_token = 'keystone_admin_token'
$nova_db_password = 'nova_pass'
$nova_user_password = 'nova_pass'
$glance_db_password = 'glance_pass'
$glance_user_password = 'glance_pass'
$rabbit_password = 'openstack_rabbit_password'
$rabbit_user = 'openstack_rabbit_user'
$fixed_network_range = '10.0.0.0/24'
$floating_network_range = '192.168.101.64/28'
$secret_key = 'secret_key'
$mysql_root_password = 'secret'
# switch this to true to have all service log at verbose
$verbose = false
# by default it does not enable atomatically addingfloating IPs
$auto_assign_floating_ip = false
#### end shared variables #################
# all nodes whose certname matches openstack_all shouldbe
# deployed as all-in-one openstack installations.
node /openstack_all/ {
include 'apache'
class {'openstack::all':
public_address =>$ipaddress_eth0,
public_interface =>$public_interface,
private_interface =>$private_interface,
admin_email =>$admin_email,
admin_password =>$admin_password,
cinder_db_password =>$cinder_db_password,
cinder_user_password =>$cinder_user_password,
keystone_db_password =>$keystone_db_password,
keystone_admin_token =>$keystone_admin_token,
nova_db_password =>$nova_db_password,
nova_user_password =>$nova_user_password,
glance_db_password =>$glance_db_password,
glance_user_password =>$glance_user_password,
rabbit_password =>$rabbit_password,
rabbit_user =>$rabbit_user,
libvirt_type =>'kvm',
floating_range => $floating_network_range,
fixed_range =>$fixed_network_range,
verbose => $verbose,
auto_assign_floating_ip => $auto_assign_floating_ip,
secret_key => $secret_key,
neutron => false,
mysql_root_password =>$mysql_root_password,
}
class {'openstack::auth_file':
admin_password =>$admin_password,
keystone_admin_token => $keystone_admin_token,
controller_node =>'127.0.0.1',
}
}
# multi-node specific parameters
$controller_node_address = '192.168.1.80'
$controller_node_public = $controller_node_address
$controller_node_internal = $controller_node_address
node /openstack_controller/ {
# class {'nova::volume': enabled => true }
# class {'nova::volume::iscsi': }
class {'openstack::controller':
public_address =>$controller_node_public,
public_interface =>$public_interface,
private_interface =>$private_interface,
internal_address => $controller_node_internal,
floating_range =>$floating_network_range,
fixed_range =>$fixed_network_range,
# by default itdoes not enable multi-host mode
multi_host => true,
# by default isassumes flat dhcp networking mode
network_manager =>'nova.network.manager.FlatDHCPManager',
verbose => $verbose,
auto_assign_floating_ip => $auto_assign_floating_ip,
mysql_root_password =>$mysql_root_password,
admin_email =>$admin_email,
admin_password =>$admin_password,
keystone_db_password =>$keystone_db_password,
keystone_admin_token =>$keystone_admin_token,
cinder_db_password => $cinder_db_password,
cinder_user_password =>$cinder_user_password,
glance_db_password =>$glance_db_password,
glance_user_password =>$glance_user_password,
neutron => false,
nova_db_password => $nova_db_password,
nova_user_password =>$nova_user_password,
rabbit_password =>$rabbit_password,
rabbit_user =>$rabbit_user,
secret_key => $secret_key,
}
class { 'openstack::auth_file':
admin_password =>$admin_password,
keystone_admin_token => $keystone_admin_token,
controller_node =>$controller_node_internal,
}
}
node /openstack_compute/ {
class {'openstack::compute':
public_interface =>$public_interface,
private_interface =>$private_interface,
internal_address =>$ipaddress_eth0,
libvirt_type => 'kvm',
fixed_range =>$fixed_network_range,
network_manager =>'nova.network.manager.FlatDHCPManager',
multi_host => true,
cinder_db_password => $cinder_db_password,
nova_db_password =>$nova_db_password,
nova_user_password => $nova_user_password,
neutron => false,
rabbit_host => $controller_node_internal,
rabbit_password =>$rabbit_password,
rabbit_user =>$rabbit_user,
glance_api_servers => "${controller_node_internal}:9292",
vncproxy_host =>$controller_node_public,
vnc_enabled => true,
verbose => $verbose,
manage_volumes => true,
volume_group =>'cinder-volumes'
}
} 10,为controller签发证书:
$ sudo puppet agent –t –-certname openstack_controller
$ sudo puppet cert sign openstack_controller 11,部署controller节点
$ sudo puppet agent –t –certname openstack_controller 12,修改/etc/openstack-dashboard/local_settings.py中的ALLOWED_HOSTS ,设定为 ['*']
13,重启apache
$ sudo service apache2 restart 14,访问http://192.168.1.80,登录horizon。
|
|