Openstack-Devstack:无法创建实例,可用主机不足 [英] Openstack-Devstack: Can't create instance, There are not enough hosts available

查看:473
本文介绍了Openstack-Devstack:无法创建实例,可用主机不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu 14.04上通过devstack安装了openstack.我的计算机上有8 GB的内存,并且创建了大约8个VM,由于我使用VM的方式不同,所以我不能同时使用. 现在,我无法再创建任何VM.我收到错误消息

I installed openstack via devstack on Ubuntu 14.04. I have got 8 gb of ram on my computer and i have created around 8 VM's which i don't use simultaneously as I use the VM differently. Now i cannot create any more VM's. I get an error message

未找到有效主机. 没有足够的主机.

No Valid Host was found. there are not enough hosts available.

有人可以建议我该怎么做?

Can someone advice what should i do?

推荐答案

由于您说这是一个devstack安装,因此我假设您不在生产环境中运行它. Openstack允许用户提高其RAM的超额预订比率.默认情况下,它保持为计算机可用物理RAM的1.5倍.因此,它应该是12 Gb的可用内存.要更改订阅比例:

Since you say that this is a devstack installation, I'm assuming that you aren't running this in a production environment. Openstack allows users to bump up their over-subscription ratio for the RAM. By default, it is kept at 1.5 times the physical RAM available in the machine. Hence, it should be 12 Gb of usable memory. To change the subscription ratio:

sudo vim /etc/nova/nova.conf
#Add these two lines
ram_allocation_ratio=2
cpu_allocation_ratio=20 # Default value here is 16

这些值只是一个粗略的估计.更改周围的值,以使它们适用于您的环境.重新启动Devstack.

These values are just a rough estimate. Change the values around to make them work for your environment. Restart the Devstack.

要检查是否进行了更改,请登录mysql(或支持devstack的任何DB)并检查:

To check if the changes were made, log into mysql (or whichever DB is supporting devstack) and check:

mysql> use nova;
mysql> select * from compute_nodes \G;
*************************** 1. row ***************************
      created_at: 2015-09-25 13:52:55
      updated_at: 2016-02-03 18:32:49
      deleted_at: NULL
              id: 1
      service_id: 7
           vcpus: 8
       memory_mb: 12007
        local_gb: 446
      vcpus_used: 6
  memory_mb_used: 8832
   local_gb_used: 80
 hypervisor_type: QEMU
    disk_available_least: 240
     free_ram_mb: 3175
    free_disk_gb: 366
    current_workload: 0
     running_vms: 4
       pci_stats: NULL
         metrics: []
.....
1 row in set (0.00 sec)

调度程序查看free_ram_mb.如果您的free_ram_mb为3175,并且要运行具有4096M内存的新m1.medium实例,则调度程序将在日志中显示以下消息:

The Scheduler looks at the free_ram_mb. If you have a free_ram_mb of 3175 and if you want to run a new m1.medium instance with 4096M of memory, the Scheduler will end up with this message in the logs:

WARNING nova.scheduler.manager Failed to schedule_run_instance: No valid host was found.

因此,在进行这些更改后,启动新VM时请务必留意这些情况.

Hence, make sure to keep an eye out for those when starting a new VM after making those changes.

这篇关于Openstack-Devstack:无法创建实例,可用主机不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆