Check launched server for x86-64-v2/sse4_2 support
The "UBI" that the latest Keycloak images are based on has a glibc compiled to only work on x86-64-v2 systems, and in some regions we seem to sometimes get hypervisors reporting older processor architectures where it won't work. Check CPU flags for sse4_2 support as an indicator, and abort launching if it's not present. Change-Id: Ib0f482a939f94e801c82f3583e0a58dc4ca1f35c
This commit is contained in:
parent
1bd482e062
commit
b44cae0233
launch/src/opendev_launch
@ -131,6 +131,9 @@ def bootstrap_server(server, key, name, volume_device, keep,
|
|||||||
|
|
||||||
ssh_client = utils.ssh_connect(ip, 'root', ssh_kwargs, timeout=timeout)
|
ssh_client = utils.ssh_connect(ip, 'root', ssh_kwargs, timeout=timeout)
|
||||||
|
|
||||||
|
if "sse4_2" not in ssh_client.ssh('cat /proc/cpuinfo', quiet=True)[1]:
|
||||||
|
raise Exception("CPU does not support x86-64-v2 (sse4_2)")
|
||||||
|
|
||||||
if not ignore_ipv6:
|
if not ignore_ipv6:
|
||||||
# Something up with RAX images that they have the ipv6 interface in
|
# Something up with RAX images that they have the ipv6 interface in
|
||||||
# /etc/network/interfaces but eth0 hasn't noticed yet; reload it
|
# /etc/network/interfaces but eth0 hasn't noticed yet; reload it
|
||||||
|
@ -38,14 +38,16 @@ class SSHClient(object):
|
|||||||
client.connect(ip, username=username, password=password, pkey=pkey)
|
client.connect(ip, username=username, password=password, pkey=pkey)
|
||||||
self.client = client
|
self.client = client
|
||||||
|
|
||||||
def ssh(self, command, error_ok=False):
|
def ssh(self, command, error_ok=False, quiet=False):
|
||||||
stdin, stdout, stderr = self.client.exec_command(command)
|
stdin, stdout, stderr = self.client.exec_command(command)
|
||||||
print('--- ssh: "%s" ---' % command)
|
print('--- ssh: "%s" ---' % command)
|
||||||
print(' -- stdout --')
|
if not quiet:
|
||||||
|
print(' -- stdout --')
|
||||||
output = ''
|
output = ''
|
||||||
for x in stdout:
|
for x in stdout:
|
||||||
output += x
|
output += x
|
||||||
sys.stdout.write(" | " + x)
|
if not quiet:
|
||||||
|
sys.stdout.write(" | " + x)
|
||||||
ret = stdout.channel.recv_exit_status()
|
ret = stdout.channel.recv_exit_status()
|
||||||
print(" -- stderr --")
|
print(" -- stderr --")
|
||||||
for x in stderr:
|
for x in stderr:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user