diff options
author | Mark Goddard <mark@stackhpc.com> | 2020-09-30 15:03:36 +0100 |
---|---|---|
committer | Mark Goddard <mark@stackhpc.com> | 2020-09-30 15:03:59 +0100 |
commit | 42d83a2bff1e91abd961c817cd70e0e0ecfc82bc (patch) | |
tree | 466b24c7e1b3b8e11e909602dff099ddbde76e56 /ironic | |
parent | 2151d660d2156c5f75986fbebe2fc7f35b0de81b (diff) | |
download | ironic-42d83a2bff1e91abd961c817cd70e0e0ecfc82bc.tar.gz |
Don't migrate away from iscsi if it is the default
We hit an issue in Kayobe CI where we have the following config:
enabled_deploy_interfaces: iscsi,direct
default_deploy_interface: iscsi
In practice, direct does not work out of the box in Kayobe currently.
The online migration added recently to move nodes from iscsi to direct
caused issues in our upgrade jobs, since it migrated nodes to direct,
without the config in place to make this work.
This change avoids migrating nodes when iscsi is the default deploy
interface.
Story: 2008114
Task: 40996
Change-Id: I5cf0684dc53a2d89fac12e578b28e73e7697a97e
Diffstat (limited to 'ironic')
-rw-r--r-- | ironic/db/sqlalchemy/api.py | 6 | ||||
-rw-r--r-- | ironic/tests/unit/db/test_api.py | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/ironic/db/sqlalchemy/api.py b/ironic/db/sqlalchemy/api.py index 3e859226c..7c478b009 100644 --- a/ironic/db/sqlalchemy/api.py +++ b/ironic/db/sqlalchemy/api.py @@ -1546,6 +1546,12 @@ class Connection(api.Connection): 'force=true to override.') return 0, 0 + if CONF.default_deploy_interface == 'iscsi': + LOG.warning('The iscsi deploy interface is the default, will ' + 'not migrate nodes away from it. Run with ' + '--option force=true to override.') + return 0, 0 + if CONF.agent.image_download_source == 'swift': LOG.warning('The direct deploy interface is using swift, will ' 'not migrate nodes to it. Run with --option ' diff --git a/ironic/tests/unit/db/test_api.py b/ironic/tests/unit/db/test_api.py index 9252e1d59..701d1afc4 100644 --- a/ironic/tests/unit/db/test_api.py +++ b/ironic/tests/unit/db/test_api.py @@ -290,6 +290,14 @@ class MigrateFromIscsiTestCase(base.DbTestCase): self.assertEqual( (0, 0), self.dbapi.migrate_from_iscsi_deploy(self.context, 0)) + def test_migration_impossible3(self): + self.config(default_deploy_interface='iscsi') + for _i in range(3): + uuid = uuidutils.generate_uuid() + utils.create_test_node(uuid=uuid, deploy_interface='iscsi') + self.assertEqual( + (0, 0), self.dbapi.migrate_from_iscsi_deploy(self.context, 0)) + def test_force_migration(self): self.config(enabled_deploy_interfaces='iscsi') utils.create_test_node(deploy_interface='direct') |