launch-node.py : add option to skip ipv6 address checks
As noted inline, this needs to be skipped on OVH (and I always forget, and debug this over and over when launching a mirror node there :). Change-Id: I07780e29f5fef75cdbab3b504f278387ddc4b13f
This commit is contained in:
parent
263ab148fe
commit
f673b71466
@ -94,7 +94,7 @@ def stream_syslog(ssh_client):
|
|||||||
|
|
||||||
|
|
||||||
def bootstrap_server(server, key, name, volume_device, keep,
|
def bootstrap_server(server, key, name, volume_device, keep,
|
||||||
mount_path, fs_label, environment, timeout):
|
mount_path, fs_label, environment, timeout, ignore_ipv6):
|
||||||
|
|
||||||
ip = server.public_v4
|
ip = server.public_v4
|
||||||
ssh_kwargs = dict(pkey=key)
|
ssh_kwargs = dict(pkey=key)
|
||||||
@ -120,13 +120,14 @@ 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)
|
||||||
|
|
||||||
# Something up with RAX images that they have the ipv6 interface in
|
if not ignore_ipv6:
|
||||||
# /etc/network/interfaces but eth0 hasn't noticed yet; reload it
|
# Something up with RAX images that they have the ipv6 interface in
|
||||||
ssh_client.ssh('(ifdown eth0 && ifup eth0) || true')
|
# /etc/network/interfaces but eth0 hasn't noticed yet; reload it
|
||||||
|
ssh_client.ssh('(ifdown eth0 && ifup eth0) || true')
|
||||||
|
|
||||||
if server.public_v6:
|
if server.public_v6:
|
||||||
ssh_client.ssh('ping6 -c5 -Q 0x10 review.openstack.org '
|
ssh_client.ssh('ping6 -c5 -Q 0x10 review.openstack.org '
|
||||||
'|| ping6 -c5 -Q 0x10 wiki.openstack.org')
|
'|| ping6 -c5 -Q 0x10 wiki.openstack.org')
|
||||||
|
|
||||||
ssh_client.scp(os.path.join(SCRIPT_DIR, '..', 'make_swap.sh'),
|
ssh_client.scp(os.path.join(SCRIPT_DIR, '..', 'make_swap.sh'),
|
||||||
'make_swap.sh')
|
'make_swap.sh')
|
||||||
@ -208,7 +209,7 @@ def bootstrap_server(server, key, name, volume_device, keep,
|
|||||||
def build_server(cloud, name, image, flavor,
|
def build_server(cloud, name, image, flavor,
|
||||||
volume, keep, network, boot_from_volume, config_drive,
|
volume, keep, network, boot_from_volume, config_drive,
|
||||||
mount_path, fs_label, availability_zone, environment,
|
mount_path, fs_label, availability_zone, environment,
|
||||||
volume_size, timeout):
|
volume_size, timeout, ignore_ipv6):
|
||||||
key = None
|
key = None
|
||||||
server = None
|
server = None
|
||||||
|
|
||||||
@ -246,6 +247,7 @@ def build_server(cloud, name, image, flavor,
|
|||||||
cloud.delete_keypair(key_name)
|
cloud.delete_keypair(key_name)
|
||||||
|
|
||||||
server = cloud.get_openstack_vars(server)
|
server = cloud.get_openstack_vars(server)
|
||||||
|
|
||||||
if volume:
|
if volume:
|
||||||
volume = cloud.get_volume(volume)
|
volume = cloud.get_volume(volume)
|
||||||
volume_device = cloud.get_volume_attach_device(volume,
|
volume_device = cloud.get_volume_attach_device(volume,
|
||||||
@ -253,7 +255,7 @@ def build_server(cloud, name, image, flavor,
|
|||||||
else:
|
else:
|
||||||
volume_device = None
|
volume_device = None
|
||||||
bootstrap_server(server, key, name, volume_device, keep,
|
bootstrap_server(server, key, name, volume_device, keep,
|
||||||
mount_path, fs_label, environment, timeout)
|
mount_path, fs_label, environment, timeout, ignore_ipv6)
|
||||||
print('UUID=%s\nIPV4=%s\nIPV6=%s\n' % (
|
print('UUID=%s\nIPV4=%s\nIPV6=%s\n' % (
|
||||||
server.id, server.public_v4, server.public_v6))
|
server.id, server.public_v4, server.public_v6))
|
||||||
except Exception:
|
except Exception:
|
||||||
@ -337,6 +339,10 @@ def main():
|
|||||||
parser.add_argument("--timeout", dest="timeout",
|
parser.add_argument("--timeout", dest="timeout",
|
||||||
help="Increase timeouts (default 600s)",
|
help="Increase timeouts (default 600s)",
|
||||||
type=int, default=600)
|
type=int, default=600)
|
||||||
|
parser.add_argument("--ignore_ipv6", dest="ignore_ipv6",
|
||||||
|
help="Ignore IPv6 addresses from API",
|
||||||
|
action='store_true', default=False)
|
||||||
|
|
||||||
parser.add_argument("--az", dest="availability_zone", default=None,
|
parser.add_argument("--az", dest="availability_zone", default=None,
|
||||||
help="AZ to boot in.")
|
help="AZ to boot in.")
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
@ -366,6 +372,14 @@ def main():
|
|||||||
print(i.name)
|
print(i.name)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
# NOTE(ianw): 2019-06-26 for whatever reason OVH assigns an IPv6
|
||||||
|
# address that is seen in API queries, but it is not in the host
|
||||||
|
# metadata so the interface isn't autoconfigured. Auto skip it to
|
||||||
|
# avoid this bombing out.
|
||||||
|
if "-ovh" in options.cloud:
|
||||||
|
print("Ignoring IPv6 for OVH cloud instances")
|
||||||
|
options.ignore_ipv6 = True
|
||||||
|
|
||||||
server = build_server(cloud, options.name, image, flavor,
|
server = build_server(cloud, options.name, image, flavor,
|
||||||
options.volume, options.keep,
|
options.volume, options.keep,
|
||||||
options.network, options.boot_from_volume,
|
options.network, options.boot_from_volume,
|
||||||
@ -373,7 +387,7 @@ def main():
|
|||||||
options.mount_path, options.fs_label,
|
options.mount_path, options.fs_label,
|
||||||
options.availability_zone,
|
options.availability_zone,
|
||||||
options.environment, options.volume_size,
|
options.environment, options.volume_size,
|
||||||
options.timeout)
|
options.timeout, options.ignore_ipv6)
|
||||||
dns.print_dns(cloud, server)
|
dns.print_dns(cloud, server)
|
||||||
print("If this is a server that is expected to send email (ask, review,")
|
print("If this is a server that is expected to send email (ask, review,")
|
||||||
print("lists, etc) double check that the server's IPs are not listed on")
|
print("lists, etc) double check that the server's IPs are not listed on")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user