Skip to content

Commit 5453398

Browse files
author
Thibaut Demaret
committed
storage: fill NVMe-oF gaps in non-interactive mode, HA config, and target VM setup
Add NVMEOF_NQN, NVMEOF_ADDR, NVMEOF_PORT to the non-interactive detection guard so that answer-file deployment works for NVMe-oF. Define NVMEOF_DOMAIN=12 in VDSMConstants and NVMEOF in StorageDomainType for consistency with engine and VDSM. Include nvmeof_address, nvmeof_port, nvmeof_nqn, nvmeof_host_nqn, and nvmeof_dhchap_key in hosted-engine.conf template so the HA broker can reconnect NVMe-oF storage after a failover or restart. Pass all five NVMe-oF variables through to the ansible target-vm role so the engine VM can be provisioned on NVMe-oF storage. Part of the NVMe-oF/TCP storage domain feature. Signed-off-by: Thibaut Demaret <thidem@worteks.com>
1 parent 53216ad commit 5453398

4 files changed

Lines changed: 27 additions & 1 deletion

File tree

src/ovirt_hosted_engine_setup/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ class VDSMConstants(object):
114114
ISCSI_DOMAIN = 3
115115
POSIXFS_DOMAIN = 6
116116
GLUSTERFS_DOMAIN = 7
117+
NVMEOF_DOMAIN = 12
117118
DATA_DOMAIN = 1
118119

119120

@@ -128,6 +129,7 @@ class StorageDomainType(object):
128129
CIFS = "CIFS"
129130
SHAREDFS = "SHAREDFS"
130131
GLUSTERFS = "GLUSTERFS"
132+
NVMEOF = "NVMEOF"
131133

132134

133135
@util.export

src/plugins/gr-he-ansiblesetup/core/storage_domain.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,9 @@ def _closeup(self):
551551
or self.environment[ohostedcons.StorageEnv.ISCSI_USER] is not None
552552
or self.environment[ohostedcons.StorageEnv.ISCSI_PASSWORD] is not None
553553
or self.environment[ohostedcons.StorageEnv.ISCSI_TARGET] is not None
554-
or self.environment[ohostedcons.StorageEnv.ISCSI_TARGET] is not None
554+
or self.environment[ohostedcons.StorageEnv.NVMEOF_NQN] is not None
555+
or self.environment[ohostedcons.StorageEnv.NVMEOF_ADDR] is not None
556+
or self.environment[ohostedcons.StorageEnv.NVMEOF_PORT] is not None
555557
):
556558
interactive = False
557559
while not created:

src/plugins/gr-he-ansiblesetup/core/target_vm.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,21 @@ def _closeup(self):
164164
'he_lun_id': self.environment[
165165
ohostedcons.StorageEnv.LUN_ID
166166
],
167+
'he_nvmeof_address': self.environment[
168+
ohostedcons.StorageEnv.NVMEOF_ADDR
169+
],
170+
'he_nvmeof_port': self.environment[
171+
ohostedcons.StorageEnv.NVMEOF_PORT
172+
],
173+
'he_nvmeof_nqn': self.environment[
174+
ohostedcons.StorageEnv.NVMEOF_NQN
175+
],
176+
'he_nvmeof_host_nqn': self.environment[
177+
ohostedcons.StorageEnv.NVMEOF_HOST_NQN
178+
],
179+
'he_nvmeof_dhchap_key': self.environment[
180+
ohostedcons.StorageEnv.NVMEOF_DHCHAP_KEY
181+
],
167182
'he_cdrom_uuid': self.environment[ohostedcons.VMEnv.CDROM_UUID],
168183
'he_nic_uuid': self.environment[ohostedcons.VMEnv.NIC_UUID],
169184
'he_maxvcpus': self.environment[ohostedcons.VMEnv.MAXVCPUS],

templates/hosted-engine.conf.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,10 @@ portal=@PORTAL@
2929
user=@USER@
3030
password=@PASSWORD@
3131
port=@PORT@
32+
33+
# The following are used only for NVMe-oF storage
34+
nvmeof_address=@NVMEOF_ADDR@
35+
nvmeof_port=@NVMEOF_PORT@
36+
nvmeof_nqn=@NVMEOF_NQN@
37+
nvmeof_host_nqn=@NVMEOF_HOST_NQN@
38+
nvmeof_dhchap_key=@NVMEOF_DHCHAP_KEY@

0 commit comments

Comments
 (0)