Skip to content

Commit d132240

Browse files
author
Kim Brugger
committed
refreshes the dhcp info on boot, and fixes a bug where a server would linger in the background if not enough disk available
1 parent 146a58f commit d132240

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

ehos/ehos.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,15 @@ def create_execute_nodes( config:Munch,execute_config_file:str, nr:int=1):
384384
if ( 'scratch_size' in config.ehos and
385385
config.ehos.scratch_size is not None and
386386
config.ehos.scratch_size != 'None'):
387-
388-
volume_id = cloud.volume_create(size=config.ehos.scratch_size, name=node_name)
389-
cloud.attach_volume( node_id, volume_id=volume_id)
390387

388+
try:
389+
volume_id = cloud.volume_create(size=config.ehos.scratch_size, name=node_name)
390+
cloud.attach_volume( node_id, volume_id=volume_id)
391+
except:
392+
logger.warning("Could not create execute server, not enough disk available, deleting the instance.")
393+
cloud.server_delete( node_id )
394+
395+
391396
instances.add_node( id=node_id, name=node_name, cloud=cloud_name, status='starting', state='booting')
392397
logger.debug("Execute server {}/{} is booting".format( node_id, node_name))
393398

share/execute.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ write_files:
7575
permissions: '0644'
7676

7777
runcmd:
78+
- dhclient # because the DNS server at uh-cloud is sometimes broken...
7879
- systemctl enable condor
7980
- systemctl start condor
8081
- condor_store_cred -p {password} -f /var/lock/condor/pool_password

share/master.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ write_files:
6262

6363
runcmd:
6464

65+
- dhclient # because the DNS server at uh-cloud is sometimes broken...
6566
- systemctl enable condor
6667
- systemctl start condor
6768

0 commit comments

Comments
 (0)