博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
《转》 Openstack Grizzly 指定 compute node 创建 instance
阅读量:7167 次
发布时间:2019-06-29

本文共 1838 字,大约阅读时间需要 6 分钟。

声明:此文档仅仅做学习交流使用,请勿用作其它商业用途

作者:朝阳_tony

邮箱:linzhaolover@gmail.com

2013年6月4日9:37:44 星期二

转载请注明出处:

有时我们有几个 compute node 。openstack默认是进行平衡创建,但有是我们想将某个instance 特定创建在某个compute node ,我们该如何做呢?

1、查看挂接的节点

查看一下我们挂接了哪些compute node,如我已经成功挂接了node-1;node-0是我的controller节点,也是我的计算节点;

# nova-manage service list

Binary           Host                                 Zone             Status     State Updated_At
nova-conductor    node-0                         internal         enabled    :-)   2013-06-04 01:19:01
nova-console      node-0                         internal         enabled    :-)   2013-06-04 01:19:00
nova-consoleauth  node-0                         internal         enabled    :-)   2013-06-04 01:19:00
nova-scheduler    node-0                         internal         enabled    :-)   2013-06-04 01:19:03
nova-cert         node-0                         internal         enabled    :-)   2013-06-04 01:19:00
nova-compute      node-0                         nova             enabled    :-)   2013-06-04 01:18:55
nova-compute      node-1                          nova             enabled     :-)   2013-05-28 03:31:39

2、查看有哪些image

# nova image-list
+--------------------------------------+--------------+--------+--------+
| ID                                   | Name         | Status | Server |
+--------------------------------------+--------------+--------+--------+
| fe64ff58-5a0d-48e0-972d-0f8455d28f1e |
fedora       | ACTIVE |        |
+--------------------------------------+--------------+--------+--------+
我有一个fedora 17 的image。是在网上下载的;

3、指定compute node 创建instance

$> nova help boot 

採用上面命令。我们发现有这样 --availability-zone <availability-zone>             The availability zone for instance placement. 一个參数我们通过它,就能够知道compute node;

比如:

$>  nova boot --image fedora  --flavor 1  test1  --availability-zone nova:node-1

我们将fedora这个image 创建级别为flavor 1  , 名字为 test1    创建到node-1 这个计算节点上;

4、验证一下实际启动在哪

# nova show fd1

+-------------------------------------+----------------------------------------------------------+
| Property                            | Value                                                    |
+-------------------------------------+----------------------------------------------------------+
| status                              | ACTIVE                                                   |
| updated                             | 2013-06-03T12:20:45Z                                     |
| OS-EXT-STS:task_state               | None                                                     |
| OS-EXT-SRV-ATTR:host                | node-1                                             |

我已经成功创建在node-1了;

你可能感兴趣的文章