Hello,
I am just started using proxmox and saw it missed 1 minor feature :
The ability to add multiple interfaces to openvz(containers) from the GUI.
as such i have modified the code to support this.
this is a simple hack allowing upto 4 interfaces to be configured
I plan to improve this if we can submit changes
Is there any place to submit this minor change as i see it an important one for openvz users
here is my diff of the openvz/network.htm
> $fdat{eth1mac} = PVE::Utils::trim ($fdat{eth1mac});
> $fdat{eth2mac} = PVE::Utils::trim ($fdat{eth2mac});
> $fdat{eth3mac} = PVE::Utils::trim ($fdat{eth3mac});
>
108a113,153
> if ($fdat{eth1bridge} eq 'disabled') {
> if (defined ($ifaces->{'eth1'})) {
> delete $ifaces->{'eth1'};
> $iflist = create_iflist ($ifaces);
> }
> } elsif ($fdat{eth1bridge}) {
> check_field (__("MAC Address"), $fdat{eth1mac}, 'NOTEMPTY', 'NOWHITESPACES', 'MAC');
>
> $ifaces->{'eth1'}->{create} = 1;
> $ifaces->{'eth1'}->{bridge} = $fdat{eth1bridge};
> $ifaces->{'eth1'}->{mac} = $fdat{eth1mac};
> $iflist = create_iflist ($ifaces);
> }
>
> if ($fdat{eth2bridge} eq 'disabled') {
> if (defined ($ifaces->{'eth2'})) {
> delete $ifaces->{'eth2'};
> $iflist = create_iflist ($ifaces);
> }
> } elsif ($fdat{eth1bridge}) {
> check_field (__("MAC Address"), $fdat{eth1mac}, 'NOTEMPTY', 'NOWHITESPACES', 'MAC');
>
> $ifaces->{'eth2'}->{create} = 1;
> $ifaces->{'eth2'}->{bridge} = $fdat{eth2bridge};
> $ifaces->{'eth2'}->{mac} = $fdat{eth2mac};
> $iflist = create_iflist ($ifaces);
> }
>
> if ($fdat{eth3bridge} eq 'disabled') {
> if (defined ($ifaces->{'eth3'})) {
> delete $ifaces->{'eth3'};
> $iflist = create_iflist ($ifaces);
> }
> } elsif ($fdat{eth1bridge}) {
> check_field (__("MAC Address"), $fdat{eth1mac}, 'NOTEMPTY', 'NOWHITESPACES', 'MAC');
>
> $ifaces->{'eth3'}->{create} = 1;
> $ifaces->{'eth3'}->{bridge} = $fdat{eth1bridge};
> $ifaces->{'eth3'}->{mac} = $fdat{eth1mac};
> $iflist = create_iflist ($ifaces);
> }
248c293
< if ($fdat{eth0bridge} && $fdat{eth0bridge} ne 'disabled') {
---
> if ($fdat{eth0bridge} && $fdat{eth0bridge} ne 'disabled' || $eth0bridge ne 'disabled') {
251a297,323
>
> $grid->add_row (@ea);
>
> my $eth1bridge = defined ($ifaces->{'eth1'}) ? $ifaces->{'eth1'}->{bridge} || 'vmbr1' : 'disabled';
> my $eth1mac = defined ($ifaces->{'eth1'}) ? $ifaces->{'eth1'}->{mac} : PVE::QemuServer::random_ether_addr();
> my @ea = ('eth1:',
> $brform->create_element ('eth1bridge', 'dynamicdropdown',
> $fdat{eth1bridge} || $eth1bridge,
> [ 'disabled' , @$bridges ]));
> if ($fdat{eth1bridge} && $fdat{eth1bridge} ne 'disabled' || $eth1bridge ne 'disabled') {
> push @ea, __("MAC Address") . ':',
> $brform->create_element ('eth1mac', 'text', $fdat{eth1mac} || $eth1mac);
>
> }
> $grid->add_row (@ea);
>
> my $eth2bridge = defined ($ifaces->{'eth2'}) ? $ifaces->{'eth2'}->{bridge} || 'vmbr1' : 'disabled';
> my $eth2mac = defined ($ifaces->{'eth2'}) ? $ifaces->{'eth2'}->{mac} : PVE::QemuServer::random_ether_addr();
> my @ea = ('eth2:',
> $brform->create_element ('eth2bridge', 'dynamicdropdown',
> $fdat{eth2bridge} || $eth2bridge,
> [ 'disabled' , @$bridges ]));
> if ($fdat{eth2bridge} && $fdat{eth2bridge} ne 'disabled' || $eth2bridge ne 'disabled') {
> push @ea, __("MAC Address") . ':',
> $brform->create_element ('eth2mac', 'text', $fdat{eth2mac} || $eth2mac);
>
> }
252a325,342
> my $eth3bridge = defined ($ifaces->{'eth3'}) ? $ifaces->{'eth3'}->{bridge} || 'vmbr1' : 'disabled';
> my $eth3mac = defined ($ifaces->{'eth3'}) ? $ifaces->{'eth3'}->{mac} : PVE::QemuServer::random_ether_addr();
> my @ea = ('eth3:',
> $brform->create_element ('eth3bridge', 'dynamicdropdown',
> $fdat{eth3bridge} || $eth3bridge,
> [ 'disabled' , @$bridges ]));
> if ($fdat{eth3bridge} && $fdat{eth3bridge} ne 'disabled' || $eth3bridge ne 'disabled') {
> push @ea, __("MAC Address") . ':',
> $brform->create_element ('eth3mac', 'text', $fdat{eth3mac} || $eth3mac);
>
> }
> $grid->add_row (@ea);
Regards,
Darren
I am just started using proxmox and saw it missed 1 minor feature :
The ability to add multiple interfaces to openvz(containers) from the GUI.
as such i have modified the code to support this.
this is a simple hack allowing upto 4 interfaces to be configured
I plan to improve this if we can submit changes
Is there any place to submit this minor change as i see it an important one for openvz users
here is my diff of the openvz/network.htm
> $fdat{eth1mac} = PVE::Utils::trim ($fdat{eth1mac});
> $fdat{eth2mac} = PVE::Utils::trim ($fdat{eth2mac});
> $fdat{eth3mac} = PVE::Utils::trim ($fdat{eth3mac});
>
108a113,153
> if ($fdat{eth1bridge} eq 'disabled') {
> if (defined ($ifaces->{'eth1'})) {
> delete $ifaces->{'eth1'};
> $iflist = create_iflist ($ifaces);
> }
> } elsif ($fdat{eth1bridge}) {
> check_field (__("MAC Address"), $fdat{eth1mac}, 'NOTEMPTY', 'NOWHITESPACES', 'MAC');
>
> $ifaces->{'eth1'}->{create} = 1;
> $ifaces->{'eth1'}->{bridge} = $fdat{eth1bridge};
> $ifaces->{'eth1'}->{mac} = $fdat{eth1mac};
> $iflist = create_iflist ($ifaces);
> }
>
> if ($fdat{eth2bridge} eq 'disabled') {
> if (defined ($ifaces->{'eth2'})) {
> delete $ifaces->{'eth2'};
> $iflist = create_iflist ($ifaces);
> }
> } elsif ($fdat{eth1bridge}) {
> check_field (__("MAC Address"), $fdat{eth1mac}, 'NOTEMPTY', 'NOWHITESPACES', 'MAC');
>
> $ifaces->{'eth2'}->{create} = 1;
> $ifaces->{'eth2'}->{bridge} = $fdat{eth2bridge};
> $ifaces->{'eth2'}->{mac} = $fdat{eth2mac};
> $iflist = create_iflist ($ifaces);
> }
>
> if ($fdat{eth3bridge} eq 'disabled') {
> if (defined ($ifaces->{'eth3'})) {
> delete $ifaces->{'eth3'};
> $iflist = create_iflist ($ifaces);
> }
> } elsif ($fdat{eth1bridge}) {
> check_field (__("MAC Address"), $fdat{eth1mac}, 'NOTEMPTY', 'NOWHITESPACES', 'MAC');
>
> $ifaces->{'eth3'}->{create} = 1;
> $ifaces->{'eth3'}->{bridge} = $fdat{eth1bridge};
> $ifaces->{'eth3'}->{mac} = $fdat{eth1mac};
> $iflist = create_iflist ($ifaces);
> }
248c293
< if ($fdat{eth0bridge} && $fdat{eth0bridge} ne 'disabled') {
---
> if ($fdat{eth0bridge} && $fdat{eth0bridge} ne 'disabled' || $eth0bridge ne 'disabled') {
251a297,323
>
> $grid->add_row (@ea);
>
> my $eth1bridge = defined ($ifaces->{'eth1'}) ? $ifaces->{'eth1'}->{bridge} || 'vmbr1' : 'disabled';
> my $eth1mac = defined ($ifaces->{'eth1'}) ? $ifaces->{'eth1'}->{mac} : PVE::QemuServer::random_ether_addr();
> my @ea = ('eth1:',
> $brform->create_element ('eth1bridge', 'dynamicdropdown',
> $fdat{eth1bridge} || $eth1bridge,
> [ 'disabled' , @$bridges ]));
> if ($fdat{eth1bridge} && $fdat{eth1bridge} ne 'disabled' || $eth1bridge ne 'disabled') {
> push @ea, __("MAC Address") . ':',
> $brform->create_element ('eth1mac', 'text', $fdat{eth1mac} || $eth1mac);
>
> }
> $grid->add_row (@ea);
>
> my $eth2bridge = defined ($ifaces->{'eth2'}) ? $ifaces->{'eth2'}->{bridge} || 'vmbr1' : 'disabled';
> my $eth2mac = defined ($ifaces->{'eth2'}) ? $ifaces->{'eth2'}->{mac} : PVE::QemuServer::random_ether_addr();
> my @ea = ('eth2:',
> $brform->create_element ('eth2bridge', 'dynamicdropdown',
> $fdat{eth2bridge} || $eth2bridge,
> [ 'disabled' , @$bridges ]));
> if ($fdat{eth2bridge} && $fdat{eth2bridge} ne 'disabled' || $eth2bridge ne 'disabled') {
> push @ea, __("MAC Address") . ':',
> $brform->create_element ('eth2mac', 'text', $fdat{eth2mac} || $eth2mac);
>
> }
252a325,342
> my $eth3bridge = defined ($ifaces->{'eth3'}) ? $ifaces->{'eth3'}->{bridge} || 'vmbr1' : 'disabled';
> my $eth3mac = defined ($ifaces->{'eth3'}) ? $ifaces->{'eth3'}->{mac} : PVE::QemuServer::random_ether_addr();
> my @ea = ('eth3:',
> $brform->create_element ('eth3bridge', 'dynamicdropdown',
> $fdat{eth3bridge} || $eth3bridge,
> [ 'disabled' , @$bridges ]));
> if ($fdat{eth3bridge} && $fdat{eth3bridge} ne 'disabled' || $eth3bridge ne 'disabled') {
> push @ea, __("MAC Address") . ':',
> $brform->create_element ('eth3mac', 'text', $fdat{eth3mac} || $eth3mac);
>
> }
> $grid->add_row (@ea);
Regards,
Darren