Skip to content

Drop pre-checks in stratis-cli for opposite tier and same tier device adds #838

@mulkieran

Description

@mulkieran

The stratisd error messages look like this without the expensive pre-check:

# PYTHONPATH=./src ./bin/stratis blockdev list
Pool Name   Device Node   Physical Size    Tier   UUID                                
p0          /dev/sda5        865.33 GiB    DATA   91f548a6-cb57-4aac-8bb3-14579bd82005
pn          /dev/sda2         15.70 GiB    DATA   f525d22c-d1e4-43b7-8c4f-c06891ce0378
pn          /dev/sda3            50 GiB   CACHE   08eb0411-3795-4ec9-8bc6-c9f21cecea72

# PYTHONPATH=./src ./bin/stratis pool add-data p0 /dev/sda3
Execution failed:
stratisd failed to perform the operation that you requested. It returned the following information via the D-Bus: ERROR: Some devices specified appear to be already in use by other Stratis pools: devices (/dev/sda3) appear to belong to Stratis pool with UUID dccccb6e-e82b-4f7d-b92b-21ccc2ff8aea.

# PYTHONPATH=./src ./bin/stratis pool add-cache pn /dev/sda5
Execution failed:
stratisd failed to perform the operation that you requested. It returned the following information via the D-Bus: ERROR: Some devices specified appear to be already in use by other Stratis pools: devices (/dev/sda5) appear to belong to Stratis pool with UUID 972f8338-8f60-4394-9a0f-b360e7e63853.

# PYTHONPATH=./src ./bin/stratis pool add-cache pn /dev/sda2
Execution failed:
stratisd failed to perform the operation that you requested. It returned the following information via the D-Bus: ERROR: Devices (/dev/sda2) appear to be already in use by this pool which has UUID dccccb6e-e82b-4f7d-b92b-21ccc2ff8aea, but in the data tier not the cache tier.

# PYTHONPATH=./src ./bin/stratis pool add-data pn /dev/sda3
Execution failed:
stratisd failed to perform the operation that you requested. It returned the following information via the D-Bus: ERROR: Devices (/dev/sda3) appear to be already in use by this pool which has UUID dccccb6e-e82b-4f7d-b92b-21ccc2ff8aea, but in the cache tier not the data tier.

# PYTHONPATH=./src ./bin/stratis pool add-data pn /dev/sda5
Execution failed:
stratisd failed to perform the operation that you requested. It returned the following information via the D-Bus: ERROR: Some devices specified appear to be already in use by other Stratis pools: devices (/dev/sda5) appear to belong to Stratis pool with UUID 972f8338-8f60-4394-9a0f-b360e7e63853.

# PYTHONPATH=./src ./bin/stratis pool add-data p0 /dev/sda5
Execution failed:
stratisd reported that it did not execute every action that it would have been expected to execute as a result of the command that you requested: Expected to add the specified blockdevs to the data tier in pool p0 but stratisd reports that it did not actually add some or all of the blockdevs requested; devices added: (), devices requested: (/dev/sda5)

This is how it looks now, with the expensive pre-check:

# PYTHONPATH=./src ./bin/stratis pool add-data p0 /dev/sda3
Execution failed:
It appears that you issued an unintended command: At least one of the provided devices is already owned by an existing pool's CACHE tier; device /dev/sda3 would be added to the DATA tier but is already in use in the CACHE tier of pool pn

# PYTHONPATH=./src ./bin/stratis pool add-cache pn /dev/sda5
Execution failed:
It appears that you issued an unintended command: At least one of the provided devices is already owned by an existing pool's DATA tier; device /dev/sda5 would be added to the CACHE tier but is already in use in the DATA tier of pool p0

 PYTHONPATH=./src ./bin/stratis pool add-cache pn /dev/sda2
Execution failed:
It appears that you issued an unintended command: At least one of the provided devices is already owned by an existing pool's DATA tier; device /dev/sda2 would be added to the CACHE tier but is already in use in the DATA tier of pool pn

# PYTHONPATH=./src ./bin/stratis pool add-data pn /dev/sda3
Execution failed:
It appears that you issued an unintended command: At least one of the provided devices is already owned by an existing pool's CACHE tier; device /dev/sda3 would be added to the DATA tier but is already in use in the CACHE tier of pool pn

# PYTHONPATH=./src ./bin/stratis pool add-data pn /dev/sda3
Execution failed:
It appears that you issued an unintended command: At least one of the provided devices is already owned by an existing pool's CACHE tier; device /dev/sda3 would be added to the DATA tier but is already in use in the CACHE tier of pool pn

# PYTHONPATH=./src ./bin/stratis pool add-data pn /dev/sda5
Execution failed:
It appears that you issued an unintended command: At least one of the provided devices is already owned by an existing pool's DATA tier; device /dev/sda5 would be added to the DATA tier but is already in use in the DATA tier of pool p0

The one substantive difference is that the pool name is available in the stratis-cli side error message but not the stratisd error message, which uses the UUID. It's possible the stratisd error message could give the device UUID, which might be helpful.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

misc

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions