aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/migrate_pinning_setup.yaml
blob: ee5eef3ff6d8342c38c1bc42f94fa6bce8de9e31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
##############################################################################
# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

- hosts: localhost
  roles:
    - create_flavor
    - role: set_flavor_property
      key: "hw:cpu_policy"
      value: "dedicated"
    - role: set_flavor_property
      key: "hw:numa_nodes"
      value: "1"

- hosts: nodes
  roles:
    - backup_nova_conf
    - role: set_nova_conf
      section: "DEFAULT"
      key: "live_migration_flag"
      value: "VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_TUNNELLED"
    - role: set_nova_conf
      section: "DEFAULT"
      key: "vncserver_listen"
      value: "0.0.0.0"

- hosts: controller
  roles:
    - role: set_nova_conf
      section: "DEFAULT"
      key: "scheduler_default_filters"
      value: "NUMATopologyFilter"
    - role: restart_nova_service
      service: "nova-scheduler"

- hosts: compute
  roles:
    - role: set_nova_conf
      section: "DEFAULT"
      key: "vcpu_pin_set"
      value: "{{ cpu_set }}"
    - role: restart_nova_service
      service: "nova-compute"
>% set cpu_set = cpu_set or "0,1,2,3" %} {% set memory_load = memory_load or 0 %} {% set flavor = flavor or "yardstick-migrate-flavor" %} {% set ram = ram or "2048" %} {% set vcpus = vcpus or "2" %} {% set disk = disk or "3" %} {% set provider = provider or none %} {% set physical_network = physical_network or 'physnet1' %} {% set segmentation_id = segmentation_id or none %} scenarios: - type: GetServer output: status server host: server.migrate runner: type: Iteration iteration: 1 - type: GetNumaInfo options: server: $server file: {{ file }} output: origin_numa_info host: server.migrate runner: type: Iteration iteration: 1 - type: GetMigrateTargetHost options: server: $server output: target_host runner: type: Iteration iteration: 1 - type: GetServerIp options: server: $server output: server_ip runner: type: Iteration iteration: 1 - type: AddMemoryLoad options: memory_load: {{ memory_load }} host: server.migrate runner: type: Iteration iteration: 1 - type: Migrate options: server: $server host: $target_host server_ip: $server_ip output: status migrate_time1 downtime1 runner: type: Iteration iteration: 1 - type: CheckValue options: value1: $status value2: 0 operator: eq runner: type: Iteration iteration: 1 - type: GetServer output: status server host: server.migrate runner: type: Iteration iteration: 1 - type: GetNumaInfo options: server: $server file: {{ file }} output: new_numa_info host: server.migrate runner: type: Iteration iteration: 1 - type: CheckNumaInfo options: info1: $origin_numa_info info2: $new_numa_info cpu_set: {{ cpu_set }} output: status runner: type: Iteration iteration: 1 - type: CheckValue options: value1: $status value2: true operator: eq runner: type: Iteration iteration: 1 contexts: - type: Node name: env-prepare file: {{ file }} env: type: ansible setup: migrate_pinning_setup.yaml -e "flavor={{ flavor }} ram={{ ram }} vcpus={{ vcpus }} disk={{ disk }} cpu_set={{ cpu_set }}" teardown: migrate_pinning_teardown.yaml -e "flavor={{ flavor }}" - name: migrate image: yardstick-image flavor: {{ flavor }} user: ubuntu servers: server: floating_ip: true networks: test: cidr: '10.0.1.0/24' {% if provider == "vlan" %} provider: {{provider}} physical_network: {{physical_network}} {% if segmentation_id %} segmentation_id: {{segmentation_id}} {% endif %} {% endif %}