简体   繁体   English

nova boot baremetal,选择池中的特定机器来“启动”

[英]nova boot baremetal, select specific machine in pool to 'boot'

I am using Ironic to help me deploy bare metal in a data center environment using 1U Dell servers. 我正在使用Ironic帮助我使用1U Dell服务器在数据中心环境中部署裸机。 It works very well, I can use Ironic to marshall dozens of servers in the rack, then when I need a bare metal instance (via nova) I just use the flavor associated with those servers and I get one of them. 它运行得很好,我可以使用Ironic来管理机架中的几十台服务器,然后当我需要一个裸机实例(通过nova)时,我只使用与这些服务器相关的风格,我得到其中一个。 Is there a way I can get a specific one? 有没有办法可以得到一个特定的? For example, my servers are numbered from the top, starting with control0, control1 all the way down to control39. 例如,我的服务器从顶部开始编号,从control0开始,control1一直到control39。 So, first I create all of the baremetal servers, introspect them. 所以,首先我创建所有裸机服务器,并对它们进行内省。 Then I create a flavor (like below, please forgive the pseudo code) and associate each baremetal server with that profile. 然后我创建一个味道(如下所示,请原谅伪代码)并将每个裸机服务器与该配置文件关联。

openstack flavor create --id auto --ram 6144 --disk 40 --vcpus 4 control
openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" --property "capabilities:profile"="control" control

i = 0
for each baremetal server's uuid:
  ironic node-update server-uuid add name=control$i
  i = i + 1
  ironic node-update server-uuid add properties/capabilities="profile:control,boot_option:local"

When I loop through the list I know that the servers are in top down physical order. 当我遍历列表时,我知道服务器处于自上而下的物理顺序。 What I would like to be able to do is get nova to create a boot instance on a specific ironic bare metal (like control3). 我想要做的是让nova在特定的具有讽刺意味的裸机(如control3)上创建一个启动实例。 I could create separate flavors for each one but I think there must be a way to select a specific piece of hardware? 我可以为每一个创建单独的口味,但我认为必须有一种方法来选择一个特定的硬件? Or a strategy that would pick them in the order I specify. 或者是按照我指定的顺序选择它们的策略。

I am pretty new to Ironic. 我是Ironic的新手。 I have done quite a bit of googling on the topic but haven't found anything. 我已经做了很多关于这个主题的谷歌搜索,但没有找到任何东西。 Here is how I start nova: 这是我开始新星的方式:

nova boot --flavor control --image rhel-server-7.1-x86_64-dvd.iso --nic 'net-id=723e7b11-3e61-481a-827e-e58b369dd28f' mybootinstance1

Which works fine. 哪个工作正常。 What I would like to do is have a nova boot line which uses the flavor control, and also the name (control0) or any other property that I can assign to make that machine unique. 我想要做的是使用一个使用flavor控件的nova启动行,以及我可以指定的名称(control0)或任何其他属性,以使该机器唯一。 Something like: 就像是:

nova boot --flavor control --ironic-instance-name control0 --image rhel-server-7.1-x86_64-dvd.iso --nic 'net-id=723e7b11-3e61-481a-827e-e58b369dd28f' mybootinstance1

This is actually a simplification of the nova pool selection process. 这实际上是新星池选择过程的简化。 I don't want to use a pool, but rather, a specific piece of hardware. 我不想使用池,而是使用特定的硬件。

If that isn't possible, is there a big drawback to using 40 flavors to create individual 'pools'? 如果这是不可能的,使用40种口味创建个人“池”是否有很大的缺点?

I think you can use --hint in nova boot to select specific machine in pool. 我想你可以在nova boot中使用--hint来选择池中的特定机器。 Preconditions: edit /etc/nova/nova.conf, add 'JsonFilter' in scheduler_default_filters and restart nova-scheduler.Then use nova boot command like this: 前提条件:编辑/etc/nova/nova.conf,在scheduler_default_filters中添加'JsonFilter'并重新启动nova-scheduler。然后使用nova boot命令,如下所示:

 nova boot --flavor <flavor> --image <image_id> --nic net-id=<net_id> --hint reservation=<reservation_id> --hint query='["=","$hypervisor_hostname", "<node_uuid>"]' <instance_name> 

I'm not quite familiar to this topic, but I'd like to share how to boot an instance to specific host via availability zone . 我对这个主题并不熟悉,但我想分享如何通过可用区将实例启动到特定主机

In my devstack (master) development environment, the procedure is: 在我的devstack(主)开发环境中,过程是:

$ nova availability-zone-list
+---------------------+----------------------------------------+
| Name                | Status                                 |
+---------------------+----------------------------------------+
| internal            | available                              |
| |- fcwszq           |                                        |
| | |- nova-conductor | enabled :-) 2015-11-23T06:31:46.000000 |
| | |- nova-cert      | enabled :-) 2015-11-23T06:31:41.000000 |
| | |- nova-scheduler | enabled :-) 2015-11-23T06:31:43.000000 |
| | |- nova-network   | enabled :-) 2015-11-23T06:31:44.000000 |
| nova                | available                              |
| |- fcwszq           |                                        |
| | |- nova-compute   | enabled :-) 2015-11-23T06:31:41.000000 |
+---------------------+----------------------------------------+

Note that my environment only gets one compute node whose hostname is fcwszq, but still can be specified as: 请注意,我的环境只获得一个主机名为fcwszq的计算节点,但仍可指定为:

nova boot --availability-zone nova:fcwszq --flavor 1 --image c38f0c7e-8ee0-4b0f-8a56-022040b4696f test02

If I specify a non-existent node, for example, nova:non-existent, the instance cannot be created correctly (state is ERROR). 如果我指定一个不存在的节点,例如,nova:不存在,则无法正确创建实例(状态为ERROR)。

Hope this can help you. 希望这可以帮到你。

Another way is using host aggregate and flavor metadata to boot instance on a random server in a group, reference: http://docs.openstack.org/liberty/config-reference/content/section_compute-scheduler.html#d6e21786 另一种方法是使用主机聚合和flavor元数据在组中的随机服务器上引导实例,参考: http//docs.openstack.org/liberty/config-reference/content/section_compute-scheduler.html#d6e21786

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM