-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iscsi: allow for multipath setup #4067
base: master
Are you sure you want to change the base?
Conversation
Tested manually: >>> params_1 = {'emulated_image': '/var/tmp/em1', 'target': 'iqn.2025-02.com.virttest:device.em1.target', 'image_size': '1G', 'portal_ip': '127.0.0.1', 'enable_authentication': False, 'iscsi_allow_multipath': 'yes'}
>>> params_2 = {'emulated_image': '/var/tmp/em1', 'target': 'iqn.2025-02.com.virttest:device.em2.target', 'image_size': '1G', 'portal_ip': '127.0.0.1', 'enable_authentication': False, 'iscsi_allow_multipath': 'yes'}
>>> _iscsi_1 = iscsi.Iscsi.create_iSCSI(params_1)
>>> _iscsi_2 = iscsi.Iscsi.create_iSCSI(params_2)
>>> _iscsi_1.login()
>>> _iscsi_2.login() results in # targetcli ls
o- / ......................................................................................................................... [...]
o- backstores .............................................................................................................. [...]
| o- block .................................................................................................. [Storage Objects: 0]
| o- fileio ................................................................................................. [Storage Objects: 1]
| | o- device.em1 ................................................................... [/var/tmp/em1 (1.0GiB) write-back activated]
| | o- alua ................................................................................................... [ALUA Groups: 1]
| | o- default_tg_pt_gp ....................................................................... [ALUA state: Active/optimized]
| o- pscsi .................................................................................................. [Storage Objects: 0]
| o- ramdisk ................................................................................................ [Storage Objects: 0]
o- iscsi ............................................................................................................ [Targets: 2]
| o- iqn.2025-02.com.virttest:device.em1.target ........................................................................ [TPGs: 1]
| | o- tpg1 .................................................................................................. [gen-acls, no-auth]
| | o- acls .......................................................................................................... [ACLs: 0]
| | o- luns .......................................................................................................... [LUNs: 1]
| | | o- lun0 ............................................................ [fileio/device.em1 (/var/tmp/em1) (default_tg_pt_gp)]
| | o- portals .................................................................................................... [Portals: 1]
| | o- 0.0.0.0:3260 ..................................................................................................... [OK]
| o- iqn.2025-02.com.virttest:device.em2.target ........................................................................ [TPGs: 1]
| o- tpg1 .................................................................................................. [gen-acls, no-auth]
| o- acls .......................................................................................................... [ACLs: 0]
| o- luns .......................................................................................................... [LUNs: 1]
| | o- lun0 ............................................................ [fileio/device.em1 (/var/tmp/em1) (default_tg_pt_gp)]
| o- portals .................................................................................................... [Portals: 1]
| o- 0.0.0.0:3260 ..................................................................................................... [OK]
o- loopback ......................................................................................................... [Targets: 0] and it also cleans up well: _iscsi_1.cleanup()
_iscsi_2.cleanup() # targetcli ls
o- / ......................................................................................................................... [...]
o- backstores .............................................................................................................. [...]
| o- block .................................................................................................. [Storage Objects: 0]
| o- fileio ................................................................................................. [Storage Objects: 0]
| o- pscsi .................................................................................................. [Storage Objects: 0]
| o- ramdisk ................................................................................................ [Storage Objects: 0]
o- iscsi ............................................................................................................ [Targets: 0]
o- loopback ......................................................................................................... [Targets: 0]
|
af7c609
to
e47472f
Compare
e47472f
to
b56ce48
Compare
virttest/iscsi.py
Outdated
output = process.run(device_cmd).stdout_text | ||
except process.CmdError as e: | ||
file_exists = re.match( | ||
r".*storage object.*already exists:.*", str(e), re.DOTALL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During my test with auto case, the error message is "Storage object fileio/device.emulated-iscsi exists". So to cover all related message, maybe we can change it to file_exists = re.match( r".*storage object.*exists.*", str(e), re.DOTALL | re.IGNORECASE )
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @meinaLi Fixed, please review again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word "already" and the :
after exist also need to be removed. Otherwise, the absence of these in the message will cause errors.
b56ce48
to
bb09a19
Compare
Some tests need to simulate a multipath setup. For this add a new parameter. If it is allowed to create multipath the export function that creates the iscsi objects will ignore if a backstor/fileio of the given name already exists. Signed-off-by: Sebastian Mitterle <smitterl@redhat.com>
bb09a19
to
4a3bbaf
Compare
Some tests need to simulate a multipath setup.
For this add a new parameter. If it is allowed to create multipath the export function that creates the iscsi objects will ignore if a backstor/fileio of the given name already exists.