简体   繁体   English

超出配额“ CPUS”

[英]Quota 'CPUS' exceeded

I'm following the Cloud Foundry BOSH Fundamentals LiveLessons on Safari. 我正在Safari上关注Cloud Foundry BOSH基础LiveLessons。 I've deployed BOSH via bbl into GCP. 我已经通过bbl将BOSH部署到了GCP中。 I'm using a free trial account which gives me 8 vCPUs. 我正在使用一个免费试用帐户,该帐户可以给我8个vCPU。 So far I'm using two: one for Director, one for the jumpbox. 到目前为止,我使用的是两种:一种用于Director,一种用于Jumpbox。

I'm trying to deploy nginx with the following command: 我正在尝试使用以下命令部署Nginx:

bosh deploy -d nginx nginx.yml

where nginx.yml is 其中nginx.yml是

---
name: nginx

releases:
- name: nginx
  version: latest

stemcells:
- alias: ubuntu
  os: ubuntu-trusty
  version: latest

instance_groups:
- name: nginx
  azs: [z2]
  instances: 1
  vm_type: sharedcpu
  stemcell: ubuntu
  networks:
  - name: default
  jobs:
  - name: nginx
    release: nginx
    properties:
      nginx_conf: |
        worker_processes  1;
        er ror_log /var/vcap/sys/log/nginx/error.log   info;
        #pid        logs/nginx.pid; # PIDFILE is configured via monit's ctl
        events {
          worker_connections  1024;
        }
        http {
          include /var/vcap/packages/nginx/conf/mime.types;
          default_type  application/octet-stream;
          sendfile        on;
          ssi on;
          keepalive_timeout  65;
          server_names_hash_bucket_size 64;
          server {
            server_name _; # invalid value which will never trigger on a real hostname.
            listen 0.0.0.0:80;
            access_log /var/vcap/sys/log/nginx/toto-access.log;
            error_log /var/vcap/sys/log/nginx/toto-error.log;
          }
          root /var/vcap/store/nginx;
          index index.shtml index.html index.htm;
        }
      pre_start: |
        #!/bin/bash -ex
        NGINX_DIR=/var/vcap/store/nginx
        if [ ! -d $NGINX_DIR ]; then
          mkdir -p $NGINX_DIR
          cd $NGINX_DIR
          echo  '<html><title>hello</title><body><h1>Hello <!--#echo var="REMOTE_ADDR" --></h1></body></html>' > index.shtml
        fi

update:
  canaries: 1
  max_in_flight: 1
  serial: false
  canary_watch_time: 1000-60000
  update_watch_time: 1000-60000

which gives me the following error: 这给了我以下错误:

Task 8

Task 8 | 15:47:32 | Preparing deployment: Preparing deployment (00:00:01)
Task 8 | 15:47:33 | Preparing package compilation: Finding packages to compile (00:00:00)
Task 8 | 15:47:33 | Compiling packages: nginx/d6ddf5c4782669341b260a27c53208d32a17b3a5 (00:00:10)
                   L Error: CPI error 'Bosh::Clouds::VMCreationFailed' with message 'VM failed to create: googleapi: Error 403: Quota 'CPUS' exceeded. Limit: 8.0 in region europe-west3., quotaExceeded' in 'create_vm' CPI method
Task 8 | 15:47:43 | Error: CPI error 'Bosh::Clouds::VMCreationFailed' with message 'VM failed to create: googleapi: Error 403: Quota 'CPUS' exceeded. Limit: 8.0 in region europe-west3., quotaExceeded' in 'create_vm' CPI method

Given I should have 6 vCPUs left, I tried to manually create instances via the web console to see if I would get a similar error. 鉴于我应该还有6个vCPU,我尝试通过Web控制台手动创建实例,以查看是否会出现类似的错误。 I didn't, I was able to create instances using up the remaining 6 vCPUs. 我没有,我能够用完剩余的6个vCPU来创建实例。 Any idea what's going on? 知道发生了什么吗?

Compilation VMs on bbl deployed environments take up 8 CPUs by default, which can eat up your quota very fast. 默认情况下,在bbl部署环境中的编译VM占用8个CPU,这会很快耗尽您的配额。 The size of the compilation VMs is set by the BOSH cloud config. 编译VM的大小由BOSH云配置设置。

The steps to fix this depend on your version of bbl . 解决此问题的步骤取决于您的bbl版本。 This fix assumes you're using bbl 5 or later. 此修复程序假设您使用的是bbl 5或更高版本。

Write a file with the following contents into the cloud-config directory of your bbl state directory: 将具有以下内容的文件写入bbl状态目录的cloud-config目录中:

- type: replace
  path: /compilation/vm_type
  value: n1-highcpu-2
- type: replace
  path: /compilation/workers
  value: 1

(You can call this file what you want as long as it does not ovverride an existing file. I would call it something like compilation-vms.yml .) (您可以将其命名为所需的文件,只要它不覆盖现有文件即可。我将其compilation-vms.yml 。)

Then run bbl up again. 然后再次运行bbl up

The next time your BOSH director tries to create compilation VMs, it will default to a single 2-CPU VM. 下次您的BOSH Director尝试创建编译VM时,它将默认为单个2-CPU VM。

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

相关问题
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM