Initialize the basic CLI REST environment which is expected on some
PVE methods we may rely on.
This became a specific problem recently when adding better support
for external and/or multiple ceph RBD clusters on a PVE system in
commit
cfe46e2d4a97a83f1bbe6ad656e6416399309ba2 from pve-storage,
which added a PVE::Rados call to get the underlying cluster FSID
required to build the /dev-mapped RBD path, and PVE::Rados
requires a initialized RPC/REST environment.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
use PVE::LXC::Tools;
use PVE::LXC;
use PVE::Network;
+use PVE::RESTEnvironment;
use PVE::Storage;
use PVE::Tools;
return undef if ! -f PVE::LXC::Config->config_file($vmid);
+ PVE::RESTEnvironment->setup_default_cli_env();
+
my $conf = PVE::LXC::Config->load_config($vmid);
my $storage_cfg = PVE::Storage::config();
use PVE::LXC::Setup;
use PVE::LXC::Tools;
use PVE::LXC;
+use PVE::RESTEnvironment;
use PVE::SafeSyslog;
use PVE::Storage;
use PVE::Syscall qw(:fsmount);
PVE::Cluster::check_cfs_quorum(); # only start if we have quorum
+ PVE::RESTEnvironment->setup_default_cli_env();
+
return undef if ! -f PVE::LXC::Config->config_file($vmid);
my $conf = PVE::LXC::Config->load_config($vmid);