Fix Rally OSP12/Pike support for IHA plugin

This commit fix the way the Rally plugin looks for the hypervisor IP
that is running the instance inside OSP12/Pike deployments. Without this
the IP would be resolved but with an address (default is the internal
network one) not reachable by the undercloud from which we need to
launch the failover command.

Change-Id: I93db75b72563f191cac73a4a749827ed3935493b
This commit is contained in:
Raoul Scarazzini 2017-12-06 12:37:27 -05:00
parent 2f38715bb1
commit 6e90e92f89
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import six
import time
import socket
from os import path
from rally.common import logging
@ -122,6 +123,7 @@ def one_killing_iteration(self, server, fip, computes, disruptor_cmd,
server_admin = self.admin_clients("nova").servers.get(server.id)
host_name_pre = getattr(server_admin, "OS-EXT-SRV-ATTR:host")
host_name_ext = host_name_pre.split('.')[0] + ".external"
hypervisors = self.admin_clients("nova").hypervisors.list()
hostnames = []
for hypervisor in hypervisors:
@ -129,7 +131,7 @@ def one_killing_iteration(self, server, fip, computes, disruptor_cmd,
if getattr(hypervisor, "hypervisor_hostname") == host_name_pre:
hypervisor_id = getattr(hypervisor, "id")
hypervisor = self.admin_clients("nova").hypervisors.get(hypervisor_id)
hypervisor_ip = getattr(hypervisor, "host_ip")
hypervisor_ip = socket.gethostbyname(host_name_ext.strip())
if not disruptor_cmd:
disruptor_cmd = {