Hi, When I create a new server or define additional ip ip address works but does not create mac address. Is there a solution or a harm?
https://prnt.sc/pu5u78
https://prnt.sc/pu5u78
Is there a solution or a harm?
I made all the updates of the system. did not improve
I could not find the file to be edited
/usr/share/perl5/PVE/LXC/Config.pm
hi,
it shouldn't cause any problems (everything should still work)
hasn't been packaged yet.
/usr/share/perl5/PVE/LXC/Config.pm
---
src/PVE/LXC/Config.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 2699d3d..7e51b8d 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -1211,6 +1211,7 @@ sub vmconfig_hotplug_pending {
} elsif ($opt =~ m/^net(\d+)$/) {
my $netid = $1;
my $net = $class->parse_lxc_network($value);
+ $value = $class->print_lxc_network($net);
PVE::LXC::update_net($vmid, $conf, $opt, $net, $netid, $rootdir);
} elsif ($opt eq 'memory' || $opt eq 'swap') {
if (!$hotplug_memory_done) { # don't call twice if both opts are passed
@@ -1297,6 +1298,10 @@ sub vmconfig_apply_pending {
if !$class->is_volume_in_use($conf, $conf->{$opt}, 1, 1);
}
}
+ } elsif ($opt =~ m/^net(\d+)$/) {
+ my $netid = $1;
+ my $net = $class->parse_lxc_network($conf->{pending}->{$opt});
+ $conf->{pending}->{$opt} = $class->print_lxc_network($net);
}
};
if (my $err = $@) {
--
2.20.1
mac.patch
/usr/share/perl5/PVE/LXC/
and apply it with: patch -N -i mac.txt
. if it asks which file to patch, type Config.pm
and it should work.patching file Config.pm
Hunk #1 succeeded at 1210 (offset -1 lines).
Hunk #2 succeeded at 1297 (offset -1 lines).
no. it's a patch so it won't work that way. download the attachment to your host.
copy this in a file:
Code:--- src/PVE/LXC/Config.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index 2699d3d..7e51b8d 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -1211,6 +1211,7 @@ sub vmconfig_hotplug_pending { } elsif ($opt =~ m/^net(\d+)$/) { my $netid = $1; my $net = $class->parse_lxc_network($value); + $value = $class->print_lxc_network($net); PVE::LXC::update_net($vmid, $conf, $opt, $net, $netid, $rootdir); } elsif ($opt eq 'memory' || $opt eq 'swap') { if (!$hotplug_memory_done) { # don't call twice if both opts are passed @@ -1297,6 +1298,10 @@ sub vmconfig_apply_pending { if !$class->is_volume_in_use($conf, $conf->{$opt}, 1, 1); } } + } elsif ($opt =~ m/^net(\d+)$/) { + my $netid = $1; + my $net = $class->parse_lxc_network($conf->{pending}->{$opt}); + $conf->{pending}->{$opt} = $class->print_lxc_network($net); } }; if (my $err = $@) { -- 2.20.1
let's saymac.patch
then go to the directory/usr/share/perl5/PVE/LXC/
and apply it with:patch -N -i mac.txt
. if it asks which file to patch, typeConfig.pm
and it should work.
Code:patching file Config.pm Hunk #1 succeeded at 1210 (offset -1 lines). Hunk #2 succeeded at 1297 (offset -1 lines).
EDIT: looks like the indentation isn't preserved correctly when pasting into the forum, so it doesn't apply when copy pasted from here...you should copy it from https://pve.proxmox.com/pipermail/pve-devel/2019-November/040143.html starting with --- and ending with 2.20.1
i added it as an attachment
runsystemctl restart pvedaemon pveproxy
and it should start showing the MAC address when you change the network settings once.
you're welcome (onemli degil). you can mark the thread as [SOLVED] so others know what to expect.