Restoring a backup keeps the 'vmstatestorage' option of the backed up
VM. When the backup is restored on another node or cluster, that
storage might not exist there or not be enabled for the node, so that
hibernating the VM or taking a snapshot including RAM fails later on,
for example with "storage 'local-zfs-pve1' does not exist".
If the configured VM state storage is not available on the node the
backup is restored to, drop the option, so that the storage is
selected automatically, like for VMs without it, and log that in the
restore task log.
A 'vmstatestorage' passed explicitly when restoring is applied after
this and is not affected.
Signed-off-by: Michal Fox <me@dualfroz.com>
When the last tag of a VM gets removed, for example in the web UI, the
API gets an empty 'tags' value, which then ends up as an empty 'tags:'
line in the config and in the output of 'qm config'. As the config
parser reads that line back as a single space, it also gets written out
again on every following config change.
Skip a tag list without any tag when writing the config, which also
cleans up existing configs with such a line on their next change. The
pending section still needs to keep it, otherwise the removal of all
tags would get lost between writing the pending change and applying it.
Signed-off-by: Michal Fox <me@dualfroz.com>