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:
parent
2f38715bb1
commit
6e90e92f89
@ -1,5 +1,6 @@
|
|||||||
import six
|
import six
|
||||||
import time
|
import time
|
||||||
|
import socket
|
||||||
|
|
||||||
from os import path
|
from os import path
|
||||||
from rally.common import logging
|
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)
|
server_admin = self.admin_clients("nova").servers.get(server.id)
|
||||||
host_name_pre = getattr(server_admin, "OS-EXT-SRV-ATTR:host")
|
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()
|
hypervisors = self.admin_clients("nova").hypervisors.list()
|
||||||
hostnames = []
|
hostnames = []
|
||||||
for hypervisor in hypervisors:
|
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:
|
if getattr(hypervisor, "hypervisor_hostname") == host_name_pre:
|
||||||
hypervisor_id = getattr(hypervisor, "id")
|
hypervisor_id = getattr(hypervisor, "id")
|
||||||
hypervisor = self.admin_clients("nova").hypervisors.get(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:
|
if not disruptor_cmd:
|
||||||
disruptor_cmd = {
|
disruptor_cmd = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user