Principle
Operations
Ironic部署過程中會看到有兩套kernel initrd 塞关, 需要知道他們是用于不同的目的。
一個是deploy image轻绞,
- 必須包含ironic python agent
- 作用是dd user image 到裸機的硬盤上博其。
一個是user image ,有2種:
-
partition image
也叫做half imge,只是一個root partition , 在寫到磁盤之后,裸機啟動有2種方式:- 從pxe啟動,使用這個user image的kernel 和 ramdisk蚓炬。
- 從硬盤啟動,這個需要配置ironic node的local boot特性躺屁。
-
whole image
- 包括分區(qū)表和bootloader
- 在whole image寫到磁盤之后肯夏,ironic就不管裸機的啟動了,默認是從硬盤啟動。
使用方式驯击,參見:
https://docs.openstack.org/project-install-guide/baremetal/draft/configure-glance-images.html
How to Deploy user image ?
無論是使用Half user image烁兰, 還是Whole user image, 開始都是使用deploy Image去實現”將 user image 寫入到 裸機的硬盤中“ 這一過程, 因此在部署時徊都,要注意配置deploy image
ironic node-update node1 add \
driver_info/deploy_kernel=$DEPLOY_KERNEL_ID \
driver_info/deploy_ramdisk=$DEPLOY_RAMDISK_ID
deploy時是先啟動一個小系統沪斟,然后將qcow2文件利用iscsi協議寫入到硬盤中去。
這個小系統里面要有ironic python agent , 要 iscsi, dd qcow2 到磁盤暇矫。
參見
使用Half User Image
上傳 half user-os image時主之,同時也要上傳kernel和initrd, 這個image的property要帶上kernel , initrd參數。
[root@cloud-sz-kolla-b13-01 ironic]# openstack image list |grep bm-user
| bea4a10b-5ff2-4105-955d-0e79358df311 | bm-user-half-centos6-initrd | active |
| 04a2d4e9-4da7-4870-88bc-71d9282aa622 | bm-user-half-centos6-kernel | active |
| e36a093d-cb18-4a72-bc7f-737502cb0f88 | bm-user-half-centos6-os | active |
| b48ace11-cec3-4a30-8cdd-ee643cccde95 | bm-user-half-centos7-initrd | active |
| 6ab91df6-1ede-4cf5-b824-dd1680ef3860 | bm-user-half-centos7-kernel | active |
| e0750ab1-41d0-419f-a418-475b8a5591f0 | bm-user-half-centos7-os | active |
| e5a3d158-dece-4fbd-ae3b-3bbf3077f560 | bm-user-whole-centos6-os | active |
| bbc8e047-0ab3-4396-b3b4-1497992723eb | bm-user-whole-centos7-os | active |
[root@cloud-b13-01 ironic]# openstack image show bm-user-half-centos7-os
+------------------+-----------------------------------------------------------------------------------------------------+
| Field | Value |
+------------------+-----------------------------------------------------------------------------------------------------+
| checksum | 7cbedc4d391e34bf24d5ad10727c512d |
| container_format | bare |
| created_at | 2017-11-17T02:54:53Z |
| disk_format | qcow2 |
| file | /v2/images/e0750ab1-41d0-419f-a418-475b8a5591f0/file |
| id | e0750ab1-41d0-419f-a418-475b8a5591f0 |
| min_disk | 0 |
| min_ram | 0 |
| name | bm-user-half-centos7-os |
| owner | 21fe1bab6b494fab94e6fded5ebd893a |
| properties | kernel_id='6ab91df6-1ede-4cf5-b824-dd1680ef3860', ramdisk_id='b48ace11-cec3-4a30-8cdd-ee643cccde95' |
| protected | False |
| schema | /v2/schemas/image |
| size | 570490880 |
| status | active |
| tags | |
| updated_at | 2017-11-17T02:54:59Z |
| virtual_size | None |
| visibility | public |
+------------------+-----------------------------------------------------------------------------------------------------+
使用whole image
Whole Image有什么好處呢李根? 什么時候適合使用Whole image ?
-> 不需要kernel, initrd文件(用于boot 裸機)
-> 方便安裝Windows操作系統槽奕。
拿centos7 whole image做測試,deploy之前is_whole_disk_image是false , 之后變成了True
| driver_internal_info | {u'agent_url': u'http://192.168.0.112:9999', u'root_uuid_or_disk_id': |
| | u'0x000666fc', u'is_whole_disk_image': True}
Local boot
Local boot是用于在ironic部署完裸機之后房轿,控制裸機的啟動方式粤攒,通常deploy完之后,裸機依然是pxe啟動囱持,參見doc
local boot就是指定從硬盤啟動夯接。
如果使用whole image,是否就不需要local boot ?
-》是的,測試發(fā)現洪唐,使用whole image時钻蹬,加不加local boot特性都一樣:默認都是從硬盤啟動。
Whole disk images, on the contrary, support only local boot, and use it by default.
測試部署centos6 half image, 沒有配置local boot,但還是報install bootloader failed的錯誤凭需。
Ironic Inspect
inspect是用來在ironic部署時做硬件檢測的问欠, 如果裸機硬盤和網卡都正常,inspect過程是完全可以跳過去的粒蜈。
inspect 之前
[root@cloud-sz-kolla-b13-01 ironic-deploy-test]# openstack hypervisor show 44e91a6a-4d7d-4f6e-812a-d3b626769b01+----------------------+--------------------------------------+
| Field | Value |
+----------------------+--------------------------------------+
| aggregates | [u'baremetal-hosts'] |
| cpu_info | |
| current_workload | 0 |
| disk_available_least | 10 |
| free_disk_gb | 10 |
| free_ram_mb | 4000 |
| host_ip | 10.54.12.22 |
| hypervisor_hostname | 44e91a6a-4d7d-4f6e-812a-d3b626769b01 |
| hypervisor_type | ironic |
| hypervisor_version | 1 |
| id | 202 |
| local_gb | 10 |
| local_gb_used | 0 |
| memory_mb | 4000 |
| memory_mb_used | 0 |
| running_vms | 0 |
| service_host | cloud-sz-control-b12-02-ironic |
| service_id | 160 |
| state | up |
| status | enabled |
| vcpus | 1 |
| vcpus_used | 0 |
+----------------------+--------------------------------------+
上面的內存顺献,磁盤大小等數據是在添加ironic節(jié)點時手動指定的,
ironic node-update $node_name add \
properties/cpus=1 \
properties/memory_mb=4000 \
properties/local_gb=10 \
properties/cpu_arch="x86_64" \
properties/capabilities="boot_option:local"
inspect 之后
[root@cloud-sz-kolla-b13-01 ironic-deploy-test]# openstack hypervisor show 44e91a6a-4d7d-4f6e-812a-d3b626769b01+----------------------+--------------------------------------+
| Field | Value |
+----------------------+--------------------------------------+
| aggregates | [u'baremetal-hosts'] |
| cpu_info | |
| current_workload | 0 |
| disk_available_least | 221 |
| free_disk_gb | 221 |
| free_ram_mb | 524288 |
| host_ip | 10.54.12.22 |
| hypervisor_hostname | 44e91a6a-4d7d-4f6e-812a-d3b626769b01 |
| hypervisor_type | ironic |
| hypervisor_version | 1 |
| id | 202 |
| local_gb | 221 |
| local_gb_used | 0 |
| memory_mb | 524288 |
| memory_mb_used | 0 |
| running_vms | 0 |
| service_host | cloud-sz-control-b12-02-ironic |
| service_id | 160 |
| state | up |
| status | enabled |
| vcpus | 112 |
| vcpus_used | 0 |
+----------------------+--------------------------------------+
所以枯怖,如果追求真實的磁盤注整,內存數據,就不要跳過inspect過程度硝。