blob: 21c2386d624134af6eef42b0b316d33b20625dbc [file] [log] [blame]
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
# Setup nova flavors with perf attributes
- name: Upgrade pbr
pip:
name: pbr
extra_args: --upgrade
become: True
- name: Install shade
pip:
name: shade
become: True
- name: Delete existing flavors except m1.tiny
os_nova_flavor:
state: absent
cacert: "{{ requests_ca_bundle }}"
auth:
auth_url: "https://keystone.{{ site_suffix }}:5000/v2.0"
username: admin
password: "{{ keystone_admin_password }}"
project_name: admin
name: "{{ item }}"
with_items:
- m1.small
- m1.medium
- m1.large
- m1.xlarge
- name: Re-create flavors with perf attributes
os_nova_flavor:
state: present
cacert: "{{ requests_ca_bundle }}"
auth:
auth_url: "https://keystone.{{ site_suffix }}:5000/v2.0"
username: admin
password: "{{ keystone_admin_password }}"
project_name: admin
name: "{{ item.name }}"
ram: "{{ item.ram }}"
vcpus: "{{ item.vcpus }}"
disk: "{{ item.disk }}"
extra_specs:
"hw:mem_page_size": 2048
"hw:cpu_policy": dedicated
with_items:
- { name: 'm1.small', ram: 2048, vcpus: 1, disk: 20 }
- { name: 'm1.medium', ram: 4096, vcpus: 2, disk: 40 }
- { name: 'm1.large', ram: 8192, vcpus: 4, disk: 80 }
- { name: 'm1.xlarge', ram: 16384, vcpus: 8, disk: 160 }