~raharper/curtin/trunk.fix-bionic-netdeps

« back to all changes in this revision

Viewing changes to curtin/block/iscsi.py

install: ensure iscsi service is running to handle shutdown properly

In some cases it is problematic to shutdown the iscsi targets (like raid
over iscsi). Instead of introducing extra work to stop multi-layer
storage devices during the install of curtin, this patch addresses the
core issue around iscsi termination; ensuring the iscsi service is active
prior to shutting down. In Artful, the open-iscsi service does not
automatically start if iscsi configuration is not present during boot;
curtin will restart/start the service if the storage configuration
contains iscsi disks.

This approach successfully passes all of the iscsi configurations
(plain, lvm over iscsi, and raid over iscsi).

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
    return target_nodes_location
196
196
 
197
197
 
 
198
def restart_iscsi_service():
 
199
    LOG.info('restarting iscsi service')
 
200
    if util.uses_systemd():
 
201
        cmd = ['systemctl', 'reload-or-restart', 'open-iscsi']
 
202
    else:
 
203
        cmd = ['service', 'open-iscsi', 'restart']
 
204
    util.subp(cmd, capture=True)
 
205
 
 
206
 
198
207
def save_iscsi_config(iscsi_disk):
199
208
    state = util.load_command_environment()
200
209
    # A nodes directory will be created in the same directory as the