Proxy support - Appliance template update

  • Thread starter Thread starter ErnoDr
  • Start date Start date
E

ErnoDr

Guest
Hello,

Our Proxmox VE server is behind a proxy. I can use the http_proxy environment variable for apt-get and wget (/etc/wgetrc), but I'm unable to update the Virtual templates list. From the command line the

pveam update

command doesn't use the http_proxy environment variable. I think, in the /usr/share/perl5/PVE/APLInfo.pm happens the updating process. Can you expand it with the proxy environment checking function? env_proxy()

Thanks in advance.
 
Hello,

Our Proxmox VE server is behind a proxy. I can use the http_proxy environment variable for apt-get and wget (/etc/wgetrc), but I'm unable to update the Virtual templates list. From the command line the

pveam update

command doesn't use the http_proxy environment variable. I think, in the /usr/share/perl5/PVE/APLInfo.pm happens the updating process. Can you expand it with the proxy environment checking function? env_proxy()

Thanks in advance.

we will take a look on this.
 
Hello,

Our Proxmox VE server is behind a proxy. I can use the http_proxy environment variable for apt-get and wget (/etc/wgetrc), but I'm unable to update the Virtual templates list. From the command line the

pveam update

command doesn't use the http_proxy environment variable. I think, in the /usr/share/perl5/PVE/APLInfo.pm happens the updating process. Can you expand it with the proxy environment checking function? env_proxy()

Thanks in advance.

Hello,

To permit communication behind a proxy i had 2 lines in /usr/share/perl5/PVE/APLInfo.pm

my $ua = LWP::UserAgent->new;

my $ProxyUrl = $ENV{http_proxy};
$ua->proxy (['http'], $ProxyUrl) if $ProxyUrl;


$ua->agent("PVE/1.0");

Regards,
 
I notice that the centos appliance was updated recently, because downloading was giving me a 404. Searching for Appliance update gave me this thread, and the command:

pveam update

which works fine.

question: have you got this scheduled to be integrated into the gui or have i just missed it?

thanks

Kerry
 
I notice that the centos appliance was updated recently, because downloading was giving me a 404. Searching for Appliance update gave me this thread, and the command:

pveam update

which works fine.

question: have you got this scheduled to be integrated into the gui or have i just missed it?

thanks

Kerry

Your Proxmox VE should update this every day automatically (internet access needed). A redesign of the appliance template manager is already scheduled but has not top priority.
 
This issue is still not fixed.

In the Proxmox VE system configuration, I can specify a proxy server to be used. That server will be used for downloading templates, but _NOT_ for downloading the appliance template directory through /etc/cron.daily/pve.

The following patch solves this:
Code:
--- APLInfo.pm  2011-03-03 09:22:10.000000000 +0100
+++ APLInfo.pm~ 2010-11-26 06:56:53.000000000 +0100
@@ -88,12 +88,7 @@
     if ($proxy) {
        $ua->proxy(['http'], $proxy);
     } else {
-       my $pvecfg = PVE::Config::read_file('pvecfg'); 
-       if ($pvecfg && $pvecfg->{http_proxy}) {
-           $ua->proxy(['http'], $pvecfg->{http_proxy});
-       } else {
-           $ua->env_proxy;
-       }
+       $ua->env_proxy;
     }
 
     eval {
 
Sorry, I do not understand your patch. You already set 'http_proxy' in /etc/pve.cfg?

Yes, I configured the proxy via the web interface, and it is now listed in /etc/pve/pve.cfg. Proxmox uses it do download appliance templates etc.

However, the daily cron job /etc/cron.daily/pve disregards that setting, so I added extra code to evaluate the configuration file and use the setting if specified.
 
so I added extra code to evaluate the configuration file and use the setting if specified.

Oh, I can see it know (you sent a reverse diff!). But I would prefer something like:

Code:
===================================================================
--- bin/cron/daily/pve    (revision 5490)
+++ bin/cron/daily/pve    (working copy)
@@ -6,8 +6,11 @@
 
 initlog ('pvedailycron', 'daemon');
 
+my $pvecfg = PVE::Config::read_file('pvecfg');
+my $proxy = ($pvecfg && $pvecfg->{http_proxy}) ? $pvecfg->{http_proxy} : undef;
+
 # update appliance info
-if (!PVE::APLInfo::update()) {
+if (!PVE::APLInfo::update($proxy)) {
     syslog ('err', "update appliance info failed - see /var/log/pveam.log for details");
 }

Please can you test that?