fix #7408: guest helpers: activate storage before checking hookscript

The hookscript is looked up on its storage without activating it first.
If the snippets live on a network storage like CIFS or NFS that is not
mounted yet, for example when a guest is started on boot, the check
fails with "script ... does not exist" and the guest does not start,
even though the storage would be mounted on its first regular use.

Activate the storage of the hookscript volume before checking the file,
as is done for any other volume used by a guest.

Signed-off-by: Michal Fox <me@dualfroz.com>
This commit is contained in:
dualfroz committed 2026-09-25 11:31:39 +02:00
1 parent cd3d13d84f
commit 30fa232ec3
1 file changed
+3
+3
View File
@@ -105,6 +105,9 @@ sub check_hookscript {
die "'$volid' is not in the snippets directory\n"
if $type ne 'snippets';
my ($storeid) = PVE::Storage::parse_volume_id($volid);
PVE::Storage::activate_storage($storecfg, $storeid);
die "script '$volid' does not exist\n"
if !-f $path;