zoukankan      html  css  js  c++  java
  • Openstack的配额共功能的使用

    在一个云系统中,一个项目不能无限制的使用资源,必须对项目进行配额管理,在openstack中主要的命令是nova quota-update, 但是可能会提示的错误:

    DEBUG (shell:740) The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-76ec703e-566e-4133-af5d-d822a6750969)
    Traceback (most recent call last):
      File "/usr/lib/python2.6/site-packages/novaclient/shell.py", line 737, in main
        OpenStackComputeShell().main(map(strutils.safe_decode, sys.argv[1:]))
      File "/usr/lib/python2.6/site-packages/novaclient/shell.py", line 673, in main
        args.func(self.cs, args)
      File "/usr/lib/python2.6/site-packages/novaclient/v1_1/shell.py", line 3198, in do_quota_update
        _quota_update(cs.quotas, args.tenant, args)
      File "/usr/lib/python2.6/site-packages/novaclient/v1_1/shell.py", line 3070, in _quota_update
        **updates)
      File "/usr/lib/python2.6/site-packages/novaclient/v1_1/quotas.py", line 77, in update
        return self._update(url, body, 'quota_set')
      File "/usr/lib/python2.6/site-packages/novaclient/base.py", line 158, in _update
        _resp, body = self.api.client.put(url, body=body)
      File "/usr/lib/python2.6/site-packages/novaclient/client.py", line 235, in put
        return self._cs_request(url, 'PUT', **kwargs)
      File "/usr/lib/python2.6/site-packages/novaclient/client.py", line 213, in _cs_request
        **kwargs)
      File "/usr/lib/python2.6/site-packages/novaclient/client.py", line 195, in _time_request
        resp, body = self.request(url, method, **kwargs)
      File "/usr/lib/python2.6/site-packages/novaclient/client.py", line 189, in request
        raise exceptions.from_response(resp, body, url, method)
    ClientException: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-76ec703e-566e-4133-af5d-d822a6750969)
    ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-76ec703e-566e-4133-af5d-d822a6750969)
    

    提示基本没有帮助。这里我们的原因是因为使用了fuel-web,他的默认配置文件中是不是用配额管理! 在/etc/nova/nova.conf配置文件中有

    quota_driver=nova.quota.DbQuotaDriver
    #quota_driver=nova.quota.NoopQuotaDriver
    

    我们必须启用DbQuotaDriver才可以,修改后执行/etc/init.d/openstack-nova-api restart即可

  • 相关阅读:
    不务正业系列-浅谈《过气堡垒》,一个RTS玩家的视角
    [LeetCode] 54. Spiral Matrix
    [LeetCode] 40. Combination Sum II
    138. Copy List with Random Pointer
    310. Minimum Height Trees
    4. Median of Two Sorted Arrays
    153. Find Minimum in Rotated Sorted Array
    33. Search in Rotated Sorted Array
    35. Search Insert Position
    278. First Bad Version
  • 原文地址:https://www.cnblogs.com/CLTANG/p/4332573.html
Copyright © 2011-2022 走看看