Skip to content
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

[SMAPIv3] xe sr-create does not report an error when SR.attach fails #5532

Open
ydirson opened this issue Mar 26, 2024 · 1 comment
Open
Assignees

Comments

@ydirson
Copy link
Contributor

ydirson commented Mar 26, 2024

xe sr-create includes auto-plugging the PBD, and as such after SR.create calls SR.attach. If for any reason SR.attach fails, this can only be seen by an error lone in SMlog - the problem is not reported to the user making the call.

ydirson added a commit to xcp-ng/xcp-ng-xapi-storage that referenced this issue Mar 26, 2024
SR can then be disposed of using "xe sr-forget" and "zpool destroy".

Underlying zpool can be either separately created and given to
SR.create, or a set of devices can be specified to create a new zpool
on.

Notes:
- `SR.attach` will be necessary to complete `sr-create`: while from a
  calling user PoV things appear to have gone fine, SMlog reveals a
  call to `SR.attach`, which naturally failed as not yet implemented.
  Any attempt to `xe pbd-plug` naturally also fails.  See
  xapi-project/xen-api#5532.
- there is no plugin feature to shield from SR.* calls

Originally-by: Matias Ezequiel Vara Larsen <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
@ydirson
Copy link
Contributor Author

ydirson commented Mar 28, 2024

Note this also impacts the XFS SR driver in XS8:

[root@xenserver-axftaywy ~]# xe sr-create type=xfs name-label="test xfs" device-config:device=/dev/nvme0n2
7b2dd6cb-14ba-7d5f-33a1-da2191cbb94d

[root@xenserver-axftaywy ~]# grep SMAPIv3 /var/log/SMlog|tail -2
Mar 28 13:05:39 xenserver-axftaywy SMAPIv3: [10569] - INFO - called as: ['/usr/libexec/xapi-storage-script/volume/org.xen.xapi.storage.xfs/SR.attach', '--json']
Mar 28 13:05:40 xenserver-axftaywy SMAPIv3: [10569] - ERROR - Exception in xapi.storage.plugin#012Traceback (most recent call last):#012  File "/usr/lib/python3.6/site-packages/xapi/storage/libs/util.py", line 252, in _log_exceptions#012    return function(*args, **kwargs)#012  File "/usr/libexec/xapi-storage-script/volume/org.xen.xapi.storage.xfs/SR.attach", line 205, in attach#012    set_scheduler(dbg, dev_path)#012  File "/usr/libexec/xapi-storage-script/volume/org.xen.xapi.storage.xfs/SR.attach", line 30, in set_scheduler#012    supported_scheds = get_supported_scheds(path)#012  File "/usr/libexec/xapi-storage-script/volume/org.xen.xapi.storage.xfs/SR.attach", line 40, in get_supported_scheds#012    with open(path, 'r') as file:#012FileNotFoundError: [Errno 2] No such file or directory: '/sys/block/nvme0n/queue/scheduler'

[root@xenserver-axftaywy ~]# xe sr-param-get uuid=7b2dd6cb-14ba-7d5f-33a1-da2191cbb94d param-name=PBDs
6fdeda0d-1f90-06b4-cc42-c57c1c477213

[root@xenserver-axftaywy ~]# xe pbd-param-get uuid=6fdeda0d-1f90-06b4-cc42-c57c1c477213 param-name=currently-attached
false

ydirson added a commit to xcp-ng/xcp-ng-xapi-storage that referenced this issue Apr 2, 2024
FIXME: pool passed through `zpool` should get a sanity check before
being accepted, and get aligned with what we otherwise create

SR can then be disposed of using "xe sr-forget" and "zpool destroy".

Underlying zpool can be either separately created and given to
SR.create, or a set of devices can be specified to create a new zpool
on.

Notes:
- `SR.attach` will be necessary to complete `sr-create`: while from a
  calling user PoV things appear to have gone fine, SMlog reveals a
  call to `SR.attach`, which naturally failed as not yet implemented.
  Any attempt to `xe pbd-plug` naturally also fails.  See
  xapi-project/xen-api#5532.
- there is no plugin feature to shield from SR.* calls

Originally-by: Matias Ezequiel Vara Larsen <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
ydirson added a commit to xcp-ng/xcp-ng-xapi-storage that referenced this issue Apr 4, 2024
Pool passed through `zpool` should still get a sanity check before
being accepted, and get aligned with what we otherwise create, to be
completed later.

SR can then be disposed of using "xe sr-forget" and "zpool destroy".

Underlying zpool can be either separately created and given to
SR.create, or a set of devices can be specified to create a new zpool
on.

Notes:
- `SR.attach` will be necessary to complete `sr-create`: while from a
  calling user PoV things appear to have gone fine, SMlog reveals a
  call to `SR.attach`, which naturally failed as not yet implemented.
  Any attempt to `xe pbd-plug` naturally also fails.  See
  xapi-project/xen-api#5532.
- there is no plugin feature to shield from SR.* calls

Originally-by: Matias Ezequiel Vara Larsen <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants