Skip to content

Instantly share code, notes, and snippets.

@uncelvel
Created July 12, 2022 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uncelvel/eaf9925761ee91639134189f508123a0 to your computer and use it in GitHub Desktop.
Save uncelvel/eaf9925761ee91639134189f508123a0 to your computer and use it in GitHub Desktop.
remove-local-storage-proxmox
sub parse_config {
my ($class, $filename, $raw) = @_;
my $cfg = $class->SUPER::parse_config($filename, $raw);
my $ids = $cfg->{ids};
=comment-out
# make sure we have a reasonable 'local:' storage
# we want 'local' to be always the same 'type' (on all cluster nodes)
if (!$ids->{local} || $ids->{local}->{type} ne 'dir' ||
($ids->{local}->{path} && $ids->{local}->{path} ne '/var/lib/vz')) {
$ids->{local} = {
type => 'dir',
priority => 0, # force first entry
path => '/var/lib/vz',
'prune-backups' => 'keep-all=1',
content => {
backup => 1,
images => 1,
iso => 1,
rootdir => 1,
snippets => 1,
vztmpl => 1,
},
};
}
# make sure we have a path
$ids->{local}->{path} = '/var/lib/vz' if !$ids->{local}->{path};
# remove node restrictions for local storage
delete($ids->{local}->{nodes});
=cut
foreach my $storeid (keys %$ids) {
my $d = $ids->{$storeid};
my $type = $d->{type};
my $def = $defaultData->{plugindata}->{$type};
if ($def->{content}) {
$d->{content} = $def->{content}->[1] if !$d->{content};
}
if (grep { $_ eq $type } @SHARED_STORAGE) {
$d->{shared} = 1;
}
}
return $cfg;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment