use PVE::Diskmanage;
use PVE::JSONSchema qw(get_standard_option);
use PVE::SafeSyslog;
+use PVE::Tools qw(run_command);
use PVE::API2::Disks::Directory;
use PVE::API2::Disks::LVM;
my $rpcenv = PVE::RPCEnvironment::get();
my $authuser = $rpcenv->get_user();
- my $worker = sub { PVE::Diskmanage::wipe_blockdev($disk); };
+ my $worker = sub {
+ PVE::Diskmanage::wipe_blockdev($disk);
+
+ # FIXME: Remove once we depend on systemd >= v249.
+ # Work around udev bug https://github.com/systemd/systemd/issues/18525 to ensure the
+ # udev database is updated.
+ eval { run_command(['udevadm', 'trigger', $disk]); };
+ warn $@ if $@;
+ };
my $basename = basename($disk); # avoid '/' in the ID
$write_ini->($ini, $mountunitpath);
+ # FIXME: Remove once we depend on systemd >= v249.
+ # Work around udev bug https://github.com/systemd/systemd/issues/18525 to ensure the
+ # udev database is updated and the $uuid_path symlink is actually created!
+ eval { run_command(['udevadm', 'trigger', $part]); };
+ warn $@ if $@;
+
run_command(['systemctl', 'daemon-reload']);
run_command(['systemctl', 'enable', $mountunitname]);
run_command(['systemctl', 'start', $mountunitname]);
use PVE::Diskmanage;
use PVE::JSONSchema qw(get_standard_option);
use PVE::API2::Storage::Config;
-use PVE::Tools qw(lock_file);
+use PVE::Tools qw(lock_file run_command);
use PVE::RPCEnvironment;
use PVE::RESTHandler;
PVE::Storage::LVMPlugin::lvm_create_volume_group($dev, $name);
+ # FIXME: Remove once we depend on systemd >= v249.
+ # Work around udev bug https://github.com/systemd/systemd/issues/18525 to ensure the
+ # udev database is updated.
+ eval { run_command(['udevadm', 'trigger', $dev]); };
+ warn $@ if $@;
+
if ($param->{add_storage}) {
my $storage_params = {
type => 'lvm',
$name
]);
+ # FIXME: Remove once we depend on systemd >= v249.
+ # Work around udev bug https://github.com/systemd/systemd/issues/18525 to ensure the
+ # udev database is updated.
+ eval { run_command(['udevadm', 'trigger', $dev]); };
+ warn $@ if $@;
+
if ($param->{add_storage}) {
my $storage_params = {
type => 'lvmthin',
run_command($cmd);
}
+ # FIXME: Remove once we depend on systemd >= v249.
+ # Work around udev bug https://github.com/systemd/systemd/issues/18525 to ensure the
+ # udev database is updated.
+ eval { run_command(['udevadm', 'trigger', $devs->@*]); };
+ warn $@ if $@;
+
if ($param->{add_storage}) {
my $storage_params = {
type => 'zfspool',