Date post: | 15-Jan-2015 |
Category: |
Technology |
Upload: | lorin-hochstein |
View: | 4,845 times |
Download: | 3 times |
+
Design of general bare_metal proxy compute node
Mikyung Kang ([email protected]) Dong-In Kang ([email protected])
May 20, 2011 1
+
LibvirtConnection (libvirt_conn.py)
TileraConnection (tilera.py)
Current Version Proxy Compute Node
Next Version Proxy Compute Node
LibvirtConnection (libvirt_conn.py)
ProxyConnection (proxy_baremetal.py)
TileraConnection (tilera.py)
ArmConnection (arm.py)
--connection_type=libvirt --connection_type=gpu
--connection_type=tilera
--connection_type=libvirt --connection_type=gpu
--baremetal_driver=tilera --baremetal_driver=arm
…..
HeckleConnection (heckle.py)
--baremetal_driver=heckle
1
2
1. Changing --connection_type: tilera baremetal 2. Adding –baremetal_driver option in nova.conf: tilera/arm/heckle/…
TODO [1] nova.conf
proxy_baremetal specific model
Specific arch. or Specific provisioning tool
2
gPXE.py?
--connection_type=baremetal
+Next Version
Proxy Compute Node
ProxyConnection (proxy_baremetal.py)
--connection_type=baremetal
TODO [2] proxy_baremetal.py overview
class ProxyConnection def _get_connection(..): // _conn <- baremetal_doms def destroy(..): // _conn.destroy_domain(..) // db.instance_set_state(..) def reboot(..): // _conn.reboot_domain(..) // db.instance_set_state(..) def spawn(..): // inject key into image // _conn.create_domain(..) // db.instance_set_state(..) def get_console_output(..): // console_log
def create_domain(..): … load bare_metal as –baremetal_driver in nova.conf baremetal_id = bare_metal.get_idle_node()
new_dom = { ’baremetal_type': bare_metal, ’baremetal_id': baremetal_id,
'name': xml_dict['name'], 'mac_address': xml_dict['mac_address'],
'ip_address': xml_dict['ip_address'], 'dhcp_server': xml_dict['dhcp_server'], 'image_id': xml_dict['image_id'], 'kernel_id': xml_dict['kernel_id'], 'ramdisk_id': xml_dict['ramdisk_id'], 'status': power_state.NOSTATE}
self.domains.append(new_dom) self.change_domain_state(..) bare_metal.set_fs(..) bare_metal.activate_node(..) …
3
+baremetal_id
TODO [3] proxy_baremetal.py: domain management
Heckle: <Name> bb01~
Tilera: <board_id> 0 ~ 9
Status field is added in __init__
[{'status': 0, 'kernel_id': '1896115634’, 'ramdisk_id': '', 'image_id': '1552326678', 'ip_address': '10.9.1.45’, 'board_id': 2, 'name': 'instance-00000046', 'vcpus': 1L, 'mac_address': '02:16:3e:1f:84:69', 'dhcp_server': '10.9.1.1'}]
• bare_metal.get_idle_node() is needed - ID format is different system by system - ID can be board_number or string name - “baremetal_type” and “baremetal_id” - return value: baremetal_id
• bare_metal.get_status() & set_status() are needed - Status can be number(0/1) or string (None/ALLOCATED) - argument and return value: 0/1 (conversion)
4
‘baremetal_type’:’tilera’, ‘baremetal_id’:2
+TODO [4] proxy_baremetal.py: get_image & set_image
set_fs
Heckle: <Image>
Tilera: bpath/root -> /tftpboot/fs_x.tar.gz
[{'status': 0, 'kernel_id': '1896115634’, 'ramdisk_id': '', 'image_id': '1552326678', 'ip_address': '10.9.1.45’, 'board_id': 2, 'name': 'instance-00000046', 'vcpus': 1L, 'mac_address': '02:16:3e:1f:84:69', 'dhcp_server': '10.9.1.1'}]
• bare_metal.get_image(baremetal_id) is needed - Case#1: passed image by euca-run-instances (every time) - no needed - Case#2: fake bare metal image / no passed image (manual) - Actual images should be passed - After getting images (path) from bare_metal, vmlinux/initrd/disk should be copied to basepath/. Then key should be injected to real disk image.
• bare_metal.set_image(baremetal_id) is needed - In case that specific directory is used for images (/tftpboot/), it should pass the key injected image into specific directory
5
/tftpboot
/bootconfig /node /image /hardware /user /powercontroller …
+TODO [5] proxy_baremetal.py: activate_node
Activate_node
Heckle: <vmlinux>
Tilera: /tftpboot/vmalinux_x_1 and _2
• bare_metal.activate_node(baremetal_id, ip_addr, mac_addr) - In case of Tilera, the first/second boot use different vmlinux.
In case of Heckle, script is used for setting activation -> bare_metal.boot_set() (Tilera:mboot <-> gPXE script) - Tilera uses ePDU management script <-> IPMI -> bare_metal.power_mgr() -> bare_metal.check_activated() - Some settings for network and services are needed -> bare_metal.network_set()
• bare_metal.deactivate_node(baremetal_id) is needed [destroy]
6
+console_output
TODO [6] proxy_baremetal.py: get_console_output
Tilera:
• bare_metal.get_console_output(instance) is needed - In case of Tilera, /proc/kmsg output is saved offline and then reused whenever it is needed b/c MDE 2.0 doesn’t support dmesg - Most bare metal machines can get dmesg output and then save before running OpenStack
7
+update_resource
TODO [7] proxy_baremetal.py: update_available_resource()
Heckle: Properties
Tilera: tilera_boards
• Needed host information - get_vcpu_total() - get_memory_mb_total() - get_local_gb_total() - get_vcpu_used() - get_memory_mb_used() - get_local_gb_used() - get_hypervisor_type() - get_hypervisor_version() - get_cpu_info()
• bare_metal.get_hw_info(field) is needed - In case of Tilera, all information is saved into tilera_boards file, and each field is loaded from file when running OpenStack, and then each specific field is retrieved through “field” arg. - vcpu: # of bare_metal node, it should be changed acct. #(run) - total/used: each information of each node - Assumption: one proxy bare_metal for homogeneous machines
8
+Overview
baremetal_dom.py __init__
read_domain_from_file()
reboot_domain()
destroy_domain()
create_domain()
change_domain_state()
store_domain()
find_domain()
list_domains()
get_domain_info()
…
proxy_baremetal.py __init__
Init_host()
_get_connection()
destroy()
reboot()
spawn()
get_console_output()
update_available_resource()
…
arch.py (ex. tilera.py) class _nodes def set_status() def check_idle_node() def get_idle_node() def find_ip_w_id() def free_node() def deactivate_node() def activate_node() def get_hw_info() def get_image() def set_image() def get_console_output() def check_activated()
…
--baremetal_driver=arch or tool (tilera/arm/heckle/…)
--connection_type=baremetal
Should be separated into 2 or 3 files and each func.
should be added/modified!
9