Skip to main content

Cloud Custodian - OpenStack Provider

Project description

Custodian OpenStack Support

Work in Progress - Not Ready For Use.

Quick Start


pip install c7n_openstack

OpenStack Environment Configration

C7N will find cloud config for as few as 1 cloud and as many as you want to put in a config file. It will read environment variables and config files, and it also contains some vendor specific default values so that you don't have to know extra info to use OpenStack:

  • If you have a config file, you will get the clouds listed in it
  • If you have environment variables, you will get a cloud named envvars
  • If you have neither, you will get a cloud named defaults with base defaults

Create a clouds.yml file:

   region_name: RegionOne
     username: 'admin'
     password: XXXXXXX
     project_name: 'admin'
     domain_name: 'Default'
     auth_url: ''

Please note: c7n will look for a file called clouds.yaml in the following locations:

  • Current Directory
  • ~/.config/openstack
  • /etc/openstack

More information at

Create a c7n policy yaml file as follows:

- name: demo
  resource: openstack.flavor
  - type: value
    key: vcpus
    value: 1
    op: gt

Run c7n and report the matched resources:

mkdir -p output
custodian run demo.yaml -s output
custodian report demo.yaml -s output --format grid


filter examples:

- name: test-flavor
  resource: openstack.flavor
  - type: value
    key: vcpus
    value: 1
    op: gt
- name: test-project
  resource: openstack.project
  filters: []
- name: test-server-image
  resource: openstack.server
  - type: image
    image_name: cirros-0.5.1
- name: test-user
  resource: openstack.user
  - type: role
    project_name: demo
    role_name: _member_
    system_scope: false
- name: test-server-flavor
  resource: openstack.server
  - type: flavor
    vcpus: 1
- name: test-server-age
  resource: openstack.server
  - type: age
    op: lt
    days: 1
- name: test-server-tags
  resource: openstack.server
  - type: tags
    - key: a
      value: a
    - key: b
      value: c
    op: any

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release. See tutorial on generating distribution archives.

Built Distribution

c7n_openstack-0.1.22-py3-none-any.whl (11.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page