Skip to content

Commit 9af2ef6

Browse files
authored
Merge pull request #2109 from deepssin/fix-ntp-rules
Add NTP security group rules for OpenStack instances
2 parents 5067830 + 87f7099 commit 9af2ef6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

teuthology/openstack/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,10 +1233,10 @@ def create_security_group(self):
12331233
server_sg = conn.network.create_security_group(name=self.server_group())
12341234
if not worker_sg:
12351235
worker_sg = conn.network.create_security_group(name=self.worker_group())
1236-
def add_rule(sg_id, protocol, port=None, remote_group_id=None):
1236+
def add_rule(sg_id, protocol, port=None, remote_group_id=None, direction='ingress'):
12371237
rule_args = {
12381238
'security_group_id': sg_id,
1239-
'direction': 'ingress',
1239+
'direction': direction,
12401240
'protocol': protocol,
12411241
'ethertype': 'IPv4',
12421242
}
@@ -1262,6 +1262,12 @@ def add_rule(sg_id, protocol, port=None, remote_group_id=None):
12621262
# access within worker group
12631263
add_rule(worker_sg.id, 'udp', port=65535, remote_group_id=worker_sg.id)
12641264

1265+
# NTP synchronization(UDP port 123)
1266+
add_rule(server_sg.id, 'udp', port=123, direction='egress')
1267+
add_rule(worker_sg.id, 'udp', port=123, direction='egress')
1268+
add_rule(server_sg.id, 'udp', port=123, direction='ingress')
1269+
add_rule(worker_sg.id, 'udp', port=123, direction='ingress')
1270+
12651271
@staticmethod
12661272
def get_unassociated_floating_ip():
12671273
"""

0 commit comments

Comments
 (0)