|
1 | 1 | OpenStack Flavors
|
2 | 2 | =================
|
3 | 3 |
|
4 |
| -This role can be used to register flavors in Nova using the |
5 |
| -`openstack.cloud.compute_flavor` module. |
| 4 | +This role can be used to register flavors in Nova and map them to projects |
| 5 | +using the `openstack.cloud.compute_flavor` module. |
6 | 6 |
|
7 | 7 | Requirements
|
8 | 8 | ------------
|
@@ -32,6 +32,16 @@ may contain 'ephemeral', 'flavorid', 'rxtx_factor' and 'swap' items.
|
32 | 32 | Optionally, the dict may also contain an item 'extra_specs', which is a dict of
|
33 | 33 | metadata to attach to the flavor object.
|
34 | 34 |
|
| 35 | +`is_public` default is `true`. It is a mandatory parameter when mapping flavor |
| 36 | +to project, and it have to be set to `false` in that case. Non public |
| 37 | +flavor can't be mapped. However there is possibility to create flavor which |
| 38 | +is private and not mapped to any project. Only 'true' and 'false' are |
| 39 | +allowed here. |
| 40 | + |
| 41 | +`project` single value, or list of projects, to which flavor should be mapped. |
| 42 | +In other words: this flavor will be visible and usable only in said project(s). |
| 43 | + |
| 44 | + |
35 | 45 | Dependencies
|
36 | 46 | ------------
|
37 | 47 |
|
@@ -63,6 +73,25 @@ The following playbook registers a Nova flavor.
|
63 | 73 | hw:cpu_policy: "dedicated"
|
64 | 74 | hw:numa_nodes: "1"
|
65 | 75 |
|
| 76 | +The following playbook will allow uasge of `flavor-1` only in project `projectA`. |
| 77 | + |
| 78 | + --- |
| 79 | + - name: Map Nova flavors to projects |
| 80 | + hosts: localhost |
| 81 | + roles: |
| 82 | + - role: openstack.cloud.compute_flavor_access |
| 83 | + os_flavors_venv: "~/os-flavors-venv" |
| 84 | + os_flavors_auth_type: "password" |
| 85 | + os_flavors_auth: |
| 86 | + project_name: <keystone project> |
| 87 | + username: <keystone user> |
| 88 | + password: <keystone password> |
| 89 | + auth_url: <keystone auth URL> |
| 90 | + os_flavors: |
| 91 | + - name: flavor-1 |
| 92 | + is_public: false |
| 93 | + project: "projectA" |
| 94 | + |
66 | 95 | Author Information
|
67 | 96 | ------------------
|
68 | 97 |
|
|
0 commit comments