ubuntu16.04 openstack ironc 环境搭建

2018-03-19  本文已影响0人  余带盐

1. 创建数据库 ironic

mysql -uroot -p123456
CREATE DATABASE ironic CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON ironic.* TO 'ironic'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON ironic.* TO 'ironic'@'%' IDENTIFIED BY '123456';

退出sql:exit


2. 安装和配置

apt-get install ironic-api ironic-conductor python-ironicclient
gedit /etc/ironic/ironic.conf
[database]
...
connection=mysql+pymysql://ironic:123456@controller/ironic?charset=utf8

[DEFAULT]
...
#rpc_backend=rabbit
transport_url = rabbit://openstack:123456@controller
auth_strategy=keystone
my_ip=192.168.0.201
enabled_drivers=pxe_ipmitool

[oslo_messaging_rabbit]
...
rabbit_host=controller
#rabbit_userid=guest
#rabbit_password=guest

注:rabbit_host 已经是过时了

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = ironic
password = 123456

[conductor]
api_url=http://192.168.0.201:6385

[glance]
glance_host=controller

[pxe]
pxe_append_params = nofb nomodesetvga=normal console=tty0 console=ttyS0,9600n8
tftp_server=192.168.0.201

[neutron]
url=http://controller:9696
auth_type = password
auth_url=https://controller:5000/
username=ironic
password=123456
project_name=service
project_domain_id=default
user_domain_id=default
cafile=/opt/stack/data/ca-bundle.pem
ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema
service ironic-api restart
service ironic-conductor restart

3. 身份认证

. admin-openrc
openstack user create --domain default --password-prompt ironic
openstack role add --project service --user ironic admin
openstack service create --name ironic --description "Ironic baremetal provisioning service" baremetal
openstack endpoint create --region RegionOne baremetal public http://controller:6385
openstack endpoint create --region RegionOne baremetal internal http://controller:6385
openstack endpoint create --region RegionOne baremetal admin http://controller:6385
openstack project create --domain default --description "Baremetal Project" baremetal

4. 配置 nova (controller 节点 和 compute1 节点)

gedit /etc/nova/nova.conf
[DEFAULT]
...
firewall_driver=nova.virt.firewall.NoopFirewallDriver
scheduler_host_manager=ironic_host_manager
compute_driver=ironic.IronicDriver
ram_allocation_ratio=1.0
reserved_host_memory_mb=0
scheduler_use_baremetal_filters=True
scheduler_tracks_instance_changes=False
scheduler_host_subset_size=9999999

[ironic]
admin_username=ironic
admin_password=123456
admin_url=http://controller:35357/v3
admin_tenant_name=service
api_endpoint=http://controller:6385

service nova-scheduler restart(控制节点)
service nova-compute restart (计算节点)
ARCH={i686|x86_64}
nova flavor-key my-baremetal-flavor set cpu_arch=$ARCH
ironic node-create -d pxe_ipmitool
image.png
ironic node-update 9e332cbe-aa94-410f-83cc-541ff2b890d9 add driver_info/deploy_kernel=0c70c21e-be72-49ce-a1fd-ea0e4562dcff driver_info/deploy_ramdisk=756d3dd0-93ff-45d1-aebd-16168db7a6b6

4. 配置 network (controller 节点 ,暂时不使用)

gedit /etc/neutron/plugins/ml2/ml2_conf.ini
[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
enable_security_group = True

[ovs]
bridge_mappings = provider:eth0

5. 下载 diskimage-builder(暂时不用)

sudo apt install python-pip
pip install diskimage-builder

6. 配置 ironic cleaning

neutron net-list
gedit /etc/ironic/ironic.conf
[neutron]
...
cleaning_network_uuid = 88698ec8-9075-4df1-98cd-505a9a1de229
service ironic-conductor restart
上一篇下一篇

猜你喜欢

热点阅读