Ironic 安裝和配置詳解

?

轉自:http://amar266.blogspot.com/2014/12/ironic-installation-and-configuration.html

?

1.Install Openstack With Neutron

2.Create and delete vm to test the setup

3.Configure existing setup for ironic

?3.1.Configure ironic user in keystone

 # keystone user-create --name=ironic --pass=IRONIC_PASSWORD   --email=ironic@example.com # keystone user-role-add --user=ironic --tenant=service --role=admin

?3.2.Register ironic with keystone

 # keystone service-create --name=ironic --type=baremetal --description="Ironic bare metal provisioning service"# keystone endpoint-create  --service-id=the_service_id_above --publicurl=http://IRONIC_NODE:6385 --internalurl=http://IRONIC_NODE:6385 --  adminurl=http://IRONIC_NODE:6385 

?

?3.3.Setup DataBase

 # mysql -u root -pmysql> CREATE DATABASE ironic CHARACTER SET utf8;mysql> GRANT ALL PRIVILEGES ON ironic.* TO 'ironic'@'localhost' \IDENTIFIED BY 'IRONIC_DBPASSWORD';mysql> GRANT ALL PRIVILEGES ON ironic.* TO 'ironic'@'%' \IDENTIFIED BY 'IRONIC_DBPASSWORD';

?3.4.The Bare Metal Service is configured via its configuration file.

This file?is typically located at /etc/ironic/ironic.conf.

[DEFAULT]
enabled_drivers = pxe_ipmitool
debug=True
auth_strategy=keystone
log_dir=/var/log/ironic/
rabbit_host=<rabbitmq_server>
[api]
port=6385
[conductor]
[database]
connection = mysql://ironic:ironic@<database_server>/ironic?charset=utf8
[glance]
glance_host=<glance_server>
glance_port=9292
glance_protocol=http
glance_num_retries=2
auth_strategy=keystone
[ipmi]
[keystone_authtoken]
signing_dir = /var/cache/ironic/api
admin_password = ironic
admin_user = ironic
admin_tenant_name = service
auth_uri = http://<keystone_server>:5000/v2.0
identity_uri = http://<keystone_server>:35357
auth_protocol = http
auth_port = 35357
auth_host = <keystone_server>
admin_token = token123
[matchmaker_redis]
[matchmaker_ring]
[neutron]
url=http://<neutron_server>:9696
[pxe]
[rpc_notifier2]
[seamicro]
[ssh]
[ssl]

3.5.Create the Bare Metal Service database tables:

#ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema 

3.6.Restart the Bare Metal Service:

#service ironic-api restart
#service ironic-conductor restart 

3.7.Configure the compute service


compute_scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler
compute_driver=ironic.nova.virt.ironic.IronicDriver
scheduler_host_manager=ironic.nova.scheduler.ironic_host_manager.IronicHostManager
ram_allocation_ratio=1.0
reserved_host_memory_mb=0


[ironic]# Ironic keystone admin name
admin_username=ironic#Ironic keystone admin password.
admin_password=ironic# keystone API endpoint
admin_url=http://<keystone_server>:35357/v2.0

# Ironic keystone tenant name.
admin_tenant_name=service# URL for Ironic API endpoint.
api_endpoint=http://<ironic_api_server>:6385/v1

?

3.8.Restart Nova services?

#service nova-scheduler restart
#service nova-compute restart

3.9.Configure Neutron

3.9.1.Edit /etc/neutron/plugins/ml2/ml2_conf.ini and modify these:


[ml2]
type_drivers = flat
tenant_network_types = flat
mechanism_drivers = openvswitch[ml2_type_flat]
flat_networks = physnet1[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
enable_security_group = True[ovs]
network_vlan_ranges = physnet1
bridge_mappings = physnet1:br-em2
# Replace eth2 with the interface on the neutron node which you
# are using to connect to the bare metal server?

3.9.2.Add the integration bridge to Open vSwitch:


#ovs-vsctl add-br br-int


3.9.3.Create the br-eth2 network bridge to handle communication between the OpenStack (and Bare Metal services) and the bare metal nodes using eth2. Replace eth2 with the interface on the neutron node which you are using to connect to the Bare Metal Service:


# ovs-vsctl add-br br-em2
# ovs-vsctl add-port br-em2 em2


3.9.4.Restart the Open vSwitch agent:

?

#service neutron-plugin-openvswitch-agent restart
#ovs-vsctl showBridge br-exPort "em1"Interface "em1"Port br-exInterface br-extype: internalBridge br-intPort "int-br-em2"Interface "int-br-em2"Port br-intInterface br-inttype: internalBridge "br-em2"Port "br-em2"Interface "br-em2"type: internalPort "phy-br-em2"Interface "phy-br-em2"Port "em2"Interface "em2"ovs_version: "2.0.1"

?????
3.9.5.Create the flat network on which you are going to launch the instances:

#neutron net-create --tenant-id $TENANT_ID sharednet1 --shared --provider:network_type flat --provider:physical_network physnet1


3.9.6.Create subnet?

#neutron subnet-create sharednet1 --gateway <GateWay> <Network_CIDR> --name subnet1 

3.10.Bare Metal provisioning requires two sets of images: the deploy images and the user images.


The disk-image-builder can be used to create images required for deployment and the actual OS which the user is going to run.

3.10.1.Clone the project and run the subsequent commands from the project directory:

#git clone https://github.com/openstack/diskimage-builder.git
#cd diskimage-builder


3.10.2.Build the image your users will run (Ubuntu image has been taken as an example):

#bin/disk-image-create -u ubuntu -o my-image

The above command creates my-image.qcow2 file. If you want to use Fedora image, replace ubuntu with fedora in the above command.

?

3.10.3.Extract the kernel & ramdisk:

#bin/disk-image-get-kernel -d ./ -o my -i $(pwd)/my-image.qcow2

The above command creates my-vmlinuz and my-initrd files. These images are used while deploying the actual OS the users will run, my-image in our case.

3.10.4.Build the deploy image:

#bin/ramdisk-image-create ubuntu deploy-ironic  -o my-deploy-ramdisk

The above command creates my-deploy-ramdisk.kernel and my-deploy-ramdisk.initramfs files which are used initially for preparing the server (creating disk partitions) before the actual OS deploy. If you want to use a Fedora image, replace ubuntu with fedora in the above command.

3.10.5.Add the user images to glance

Load all the images created in the below steps into Glance, and note the glance image UUIDs for each one as it is generated.

?

3.10.6.Add the kernel and ramdisk images to glance:

#glance image-create --name my-kernel --public  --disk-format aki  < my-vmlinuz

3.10.7.Store the image uuid obtained from the above step as $MY_VMLINUZ_UUID.

#glance image-create --name my-ramdisk --public --disk-format ari  < my-initrd
Store the image UUID obtained from the above step as $MY_INITRD_UUID.

3.10.8.Add the my-image to glance which is going to be the OS that the user is going to run. Also associate the above created images with this OS image.

These two operations can be done by executing the following command:
#glance image-create --name my-image --public --disk-format qcow2 --container-format bare --property kernel_id=$MY_VMLINUZ_UUID --property      ramdisk_id=$MY_INITRD_UUID < my-image

3.10.9.Add the deploy images to glance


Add the my-deploy-ramdisk.kernel and my-deploy-ramdisk.initramfs images to glance:
# glance image-create --name deploy-vmlinuz --public --disk-format aki < my-deploy-ramdisk.kernel

Store the image UUID obtained from the above step as $DEPLOY_VMLINUZ_UUID.
# glance image-create --name deploy-initrd --public --disk-format ari < my-deploy-ramdisk.initramfs

Store the image UUID obtained from the above step as $DEPLOY_INITRD_UUID.

3.11.You’ll need to create a special Bare Metal flavor in Nova.

The flavor is mapped to the bare metal server through the hardware specifications.


Change these to match your hardware
 RAM_MB=1024CPU=2DISK_GB=100ARCH={i686|x86_64}

?

?3.11.1.Create the baremetal flavor by executing the following command:
 #nova flavor-create my-baremetal-flavor auto $RAM_MB $DISK_GB $CPU#nova flavor-key my-baremetal-flavor set cpu_arch=$ARCH "baremetal:deploy_kernel_id"=$DEPLOY_VMLINUZ_UUID "baremetal:deploy_ramdisk_id"=$DEPLOY_INITRD_UUID

3.12. Create node in ironic


# ironic node-create -d pxe_ipmitool -i ipmi_address=<ipmi_address> -i ipmi_username=<ipmi_username> -i ipmi_password=<ipmi_password>
# ironic node-update $NODE_UUID add driver_info/pxe_deploy_kernel=$DEPLOY_VMLINUZ_UUID driver_info/pxe_deploy_ramdisk=$DEPLOY_INITRD_UUID
# ironic port-create -n <node_id> -a<mac_id of server>?

3.13.If you will be using PXE, it needs to be set up on the Bare Metal Service node(s) where ironic-conductor is running.


Make sure the tftp root directory exist and can be written to by the user the ironic-conductor is running as. For example:

#sudo mkdir -p /tftpboot
#sudo chown -R ironic -p /tftpboot
Install tftp server and the syslinux package with the PXE boot images:
Ubuntu:
#sudo apt-get install tftpd-hpa syslinux syslinux-common
Fedora/RHEL:
#sudo yum install tftp-server syslinux-tftpboot
#Setup tftp server to serve /tftpboot.

Copy the PXE image to /tftpboot. The PXE image might be found at [1]:
Ubuntu:
#sudo cp /usr/lib/syslinux/pxelinux.0 /tftpboot
#Go to /etc/defaults/tftp-hpa remove everything and paste following
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="[::]:69"
#TFTP_OPTIONS="--secure"
TFTP_OPTIONS="--map-file /tftpboot/map-file -v -v -v -v"

To be able to access absolute path on tftp do following steps
Create a map file in /tftpboot/map-file
r ^([^/]) /tftpboot/\1

tftp service should be running like below
/usr/sbin/in.tftpd --listen --user tftp --address [::]:69 --map-file /tftpboot/map-file -v -v -v -v /tftpboot

3.14.IPMI support

If using the IPMITool driver, the ipmitool command must be present on the service node(s) where ironic-conductor is running. On most distros, this is provided as part of the ipmitool package. Source code is available at http://ipmitool.sourceforge.net/

Note that certain distros, notably Mac OS X and SLES, install openipmi instead of ipmitool by default. THIS DRIVER IS NOT COMPATIBLE WITH openipmi AS IT RELIES ON ERROR HANDLING OPTIONS NOT PROVIDED BY THIS TOOL.

Check that you can connect to and authenticate with the IPMI controller in your bare metal server by using ipmitool:

ipmitool -I lanplus -H <ip-address> -U <username> -P <password> chassis power status

3.15.Test Setup with nova

nova boot --flavor baremetal --key-name mykey --image my-image  --nic net-id=d3b9b3c5-378e-493b-9515-22c17433c23a   bm1

3.16. Debug commands

3.16.1.Sometimes vm goes in error state and does not got deleted ,for that run following command in ironic

??
 ironic node-update 0d78301c-2d78-42e0-b14d-4a031e5a7cd4 remove instance_uuid

3.16.2.Always Check the node is not in maintenance mode if it is in maintenance mode then remove it
?
  ironic node-update 0d78301c-2d78-42e0-b14d-4a031e5a7cd4 replace maintenance=False

?

轉載于:https://www.cnblogs.com/pinganzi/p/6796838.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/456576.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/456576.shtml
英文地址,請注明出處:http://en.pswp.cn/news/456576.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

webpack使用優化(基本篇)

轉自&#xff1a;https://github.com/lcxfs1991/blog/issues/2 前言 本文不是webpack入門文章&#xff0c;如果對webpack還不了解&#xff0c;請前往題葉的Webpack入門&#xff0c;或者阮老師的Webpack-Demos。 為什么要使用Webpack 與react一類模塊化開發的框架搭配著用比較好…

word2vec中單詞向詞向量的轉換過程詳解

目錄前言&#xff1a;1、Word2Vec兩種模型的大致印象2、CBOW模型流程舉例3、CBOW模型流程舉例總結&#xff1a; 目錄 前言&#xff1a; 針對word2vec是如何得到詞向量的&#xff1f;這篇文章肯定能解決你的疑惑。該篇文章主要參考知乎某大神的回答&#xff0c;個人在此基礎上…

Python把函數作為參數傳入的高階編程方法

map:接受兩個參數&#xff08;函數&#xff0c;Iterable&#xff09;&#xff0c;map將傳入的函數依次作用于Iterable的每個元素&#xff0c;并且返回新的Iterable def f(x):return x*x r map(f,[1,2,3,4]) #此時的r為惰性求值——可用next()和for...in取值 #通過list()返…

《編程珠璣(第2版?修訂版)》—第2章2.2節無處不在的二分搜索

本節書摘來自異步社區《編程珠璣&#xff08;第2版?修訂版&#xff09;》一書中的第2章2.2節無處不在的二分搜索&#xff0c;作者【美】Jon Bentley&#xff0c;更多章節內容可以訪問云棲社區“異步社區”公眾號查看。 2.2 無處不在的二分搜索我想到的一個數在1到100之間&…

JavaScript學習筆記(四)——jQuery插件開發與發布

jQuery插件就是以jQuery庫為基礎衍生出來的庫&#xff0c;jQuery插件的好處是封裝功能&#xff0c;提高了代碼的復用性&#xff0c;加快了開發速度&#xff0c;現在網絡上開源的jQuery插件非常多&#xff0c;隨著版本的不停迭代越來越穩定好用&#xff0c;在jQuery官網有許多插…

AIML元素詳細說明

目錄前言&#xff1a;1、簡介2、詳細說明總結&#xff1a; 目錄 前言&#xff1a; 智能客服客戶咨詢功能的實現主要依靠的就是Python的AIML庫&#xff0c;這里就先介紹下AIML。 詳細的使用教程可參考&#xff1a;https://github.com/andelf/PyAIML 目前大部分AIML只支持Py…

【解決】如何打開.ipynb文件

最近碰到文件名后綴為.ipynb文件&#xff0c;起初沒太在意這種文件格式&#xff0c;用Notepad打開之后看到也是類似于JSON格式的信息&#xff0c;以為也是為其他的一些文件服務的&#xff08;類似于配置一些HTML文件的配置文件&#xff09;。但是后來才發現這也是一種文本表示形…

《樹莓派學習指南(基于Linux)》——1.4 將Raspbian燒錄到SD卡

本節書摘來異步社區《樹莓派學習指南&#xff08;基于Linux&#xff09;》一書中的第1章&#xff0c;第1.4節&#xff0c;作者&#xff1a;【英】Peter Membrey ,【澳】David Hows &#xff0c;更多章節內容可以訪問云棲社區“異步社區”公眾號查看 1.4 將Raspbian燒錄到SD卡 …

python單向鏈表和雙向鏈表的圖示代碼說明

圖示說明&#xff1a; 單向鏈表&#xff1a; insert、 remove、 update、pop方法 class Node:def __init__(self, data):self.data dataself.next Nonedef __str__(self):return str(self.data)# 通過單鏈表構建一個list的結構&#xff1a; 添加 刪除 插入 查找 獲取長…

不使用Ajax,如何實現表單提交不刷新頁面

不使用Ajax&#xff0c;如何實現表單提交不刷新頁面&#xff1f; 目前&#xff0c;我想到的是使用<iframe>&#xff0c;如果有其他的方式&#xff0c;后續再補。舉個栗子&#xff1a; 在表單上傳文件的時候必須設置enctype"multipart/form-data"表示表單既有文…

AIML知識庫數據匹配原理解析

目錄&#xff1a;前言&#xff1a;1、AIML系統工作流程2、AIML的核心推理機制3、推理舉例4、匹配規則及實踐中遇到的一些問題的解釋總結&#xff1a; 目錄&#xff1a; 前言&#xff1a; 參考&#xff1a;《Alice機理分析與應用研究》 關于AIML庫這里就不介紹了&#xff0c…

【Python】模擬面試技術面試題答

一、 python語法 1. 請說一下你對迭代器和生成器的區別&#xff1f; 2. 什么是線程安全&#xff1f; 3. 你所遵循的代碼規范是什么&#xff1f;請舉例說明其要求&#xff1f; 4. Python中怎么簡單的實現列表去重&#xff1f; 5. python 中 yield 的用法…

ROS機器人程序設計(原書第2版)2.3 理解ROS開源社區級

2.3 理解ROS開源社區級 ROS開源社區級的概念主要是ROS資源&#xff0c;其能夠通過獨立的網絡社區分享軟件和知識。這些資源包括&#xff1a; 發行版&#xff08;Distribution&#xff09; ROS發行版是可以獨立安裝、帶有版本號的一系列綜合功能包。ROS發行版像Linux發行版一樣…

Win7 U盤安裝Ubuntu16.04 雙系統

Win7系統下安裝Ubuntu系統&#xff0c;主要分為三步&#xff1a; 第1步&#xff1a;制作U盤啟動盤 第2步&#xff1a;安裝Ubuntu系統 第3步&#xff1a;創建啟動系統引導 第1步&#xff1a;制作U盤啟動盤 1.下載Ubuntu16.04安裝鏡像&#xff0c;官網地址&#xff1a;http://www…

Word2VecDoc2Vec總結

轉自&#xff1a;http://www.cnblogs.com/maybe2030/p/5427148.html 目錄&#xff1a;1、詞向量2、Distributed representation詞向量表示3、word2vec算法思想4、doc2vec算法思想5、Doc2Vec主要參數詳解總結&#xff1a; 目錄&#xff1a; 1、詞向量 自然語言理解的問題要轉…

ubantu安裝pycharm破解+Linux基礎簡介

一、課程簡介 linux服務器配置及常用命令 Ubuntu centos 開發軟件配置及服務環境的搭建 軟件的安裝和配置 mysql數據庫使用、monDB使用、redius的使用 git的使用 html/css 課程學習方式 表達訓練 學習方法&#xff1a; linux學習基本上都是命令和配置 命令要多敲多記 …

《游戲視頻主播手冊》——2.2 哪些人適合做游戲主播

本節書摘來自異步社區《游戲視頻主播手冊》一書中的第2章&#xff0c;第2.2節&#xff0c;作者 王巖&#xff0c;更多章節內容可以訪問云棲社區“異步社區”公眾號查看。 2.2 哪些人適合做游戲主播 據不完全統計&#xff0c;目前國內有超過26000名活躍的游戲主播。所謂“活躍的…

Doc2Vec實踐

目錄:前言&#xff1a;第一步&#xff1a;首先我們需要拿到對應的數據&#xff0c;相關的代碼如下&#xff1a;第二步&#xff1a;拿到對應的數據后&#xff0c;就開始訓練數據生成對應的model&#xff0c;對應的代碼如下&#xff1a;第三步&#xff1a;得到生成的model后&…

Linux常用命令全網最全

一、linux文件系統結構 sudo apt-get install treetree --help #查看幫助tree -L 1 #顯示文件目錄 rootubuntu16 /# tree -L 1 . #系統根目錄&#xff0c;有且只有一個根目錄 ├── bin #存放常見的命令 ├── boot #系統啟動文件和核心文件都在這個目錄…

《開源思索集》一Source Code + X

本節書摘來異步社區《開源思索集》一書中的第1章&#xff0c;作者&#xff1a; 莊表偉 責編&#xff1a; 楊海玲, 更多章節內容可以訪問云棲社區“異步社區”公眾號查看。 Source Code X 開源思索集最近&#xff0c;有一位來自學術界朋友&#xff0c;找到了我們這個開源的圈子…