Thanks. I'll look into your comments regarding the actual error handling. But there is one important question that we need to decide on. See below.

On 8/21/23 17:05, Fiona Ebner wrote:
Am 14.06.23 um 13:10 schrieb Aaron Lauterer:
It can happen, that an RBD image isn't cleaned up 100%. Calling 'rbd ls
-l' will then show errors that it is not possible to open the image in
question:
```
rbd: error opening vm-103-disk-1: (2) No such file or directory
rbd: listing images failed: (2) No such file or directory
```

Originally we only showed the last error line which is too generic and
doesn't give a good hint what is actually wrong.

We can improve that by catching these specific errors and add the
problematic disk images to the returned list with a size of '-1'.


What do you think about logging a warning instead, hinting that it might
be a partially removed image? The thing I'm a bit worried about is that
existing scripts/tools interacting with our API might get confused by
the -1. And if I use the UI, I don't see it with either approach,
because your next patch hides it. If I use the CLI, I'll see either the
warning or the -1 depending on the approach.


Showing warnings on the CLI is a good idea either way, but the question is, do we want to list a broken image? If yes, then the users are more likely to notice that something is amiss. If we only log it, then chances are rather low as only users who use the CLI will see the warnings. The downside though is, as you mentioned, that some external tools/scripts might be confused about it.

I am not sure how easy it is to pass through a dedicated parameter to the storage plugin. If, we could indicate that we want the disk images listed when we call it from the GUI for example. Though that might introduce much more complexity and discrepancy depending on which tool is used. Therefore probably not a good idea.

How we render a broken image in the GUI is something that can then be done almost any way we seem fit. It could be even something like "-1 (broken?)" in the Size column.



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to