Is there a way for VM pre-start hookscripts to dynamically append to "args:" section of VM config file ?
What I'm trying to accomplish is to append to original config "args:" without altering config.
I found something that would allow me to edit various config elements and write back to config however, if I have my script appending args it would end up appending it each and every time VM starts.
What I'm trying to accomplish is to append to original config "args:" without altering config.
I found something that would allow me to edit various config elements and write back to config however, if I have my script appending args it would end up appending it each and every time VM starts.
Perl:
my $conf = PVE::QemuConfig->load_config($vmid);
# Second argument is the phase
my $phase = shift;
if ($phase eq 'pre-start') {
# First phase 'pre-start' will be executed before the guest
# ist started. Exiting with a code != 0 will abort the start
print "$vmid is starting, doing preparations.\n";
print "$conf->{memory}";
$conf->{memory} = 32760;
print "$conf->{memory}";
PVE::QemuConfig->write_config($vmid, $conf)
;
Last edited: