[pve-devel] r5276 - in pve-manager/trunk: . debian lib/PVE www/root/vmlist

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Oct 20 10:30:10 CEST 2010


Author: dietmar
Date: 2010-10-20 08:30:09 +0000 (Wed, 20 Oct 2010)
New Revision: 5276

Modified:
   pve-manager/trunk/ChangeLog
   pve-manager/trunk/configure.in
   pve-manager/trunk/debian/changelog.Debian
   pve-manager/trunk/lib/PVE/ConfigServer.pm
   pve-manager/trunk/www/root/vmlist/create.htm
Log:


Modified: pve-manager/trunk/ChangeLog
===================================================================
--- pve-manager/trunk/ChangeLog	2010-10-18 11:52:22 UTC (rev 5275)
+++ pve-manager/trunk/ChangeLog	2010-10-20 08:30:09 UTC (rev 5276)
@@ -1,3 +1,11 @@
+2010-10-20  Proxmox Support Team  <support at proxmox.com>
+
+	* www/root/vmlist/create.htm: query capabilities of remote
+	host (kvm/openvz enabled?).
+
+	* lib/PVE/ConfigServer.pm (ping): detect openvz and add kvmversion
+	field.
+
 2010-10-05  Proxmox Support Team  <support at proxmox.com>
 
 	* bin/pveversion: also display new proxmox-ve-2.6.35 package

Modified: pve-manager/trunk/configure.in
===================================================================
--- pve-manager/trunk/configure.in	2010-10-18 11:52:22 UTC (rev 5275)
+++ pve-manager/trunk/configure.in	2010-10-20 08:30:09 UTC (rev 5276)
@@ -4,7 +4,7 @@
 
 prefix=/usr
 
-PACKAGERELEASE=5
+PACKAGERELEASE=6
 AC_SUBST(PACKAGERELEASE)
 
 REPOID=`svnversion .`

Modified: pve-manager/trunk/debian/changelog.Debian
===================================================================
--- pve-manager/trunk/debian/changelog.Debian	2010-10-18 11:52:22 UTC (rev 5275)
+++ pve-manager/trunk/debian/changelog.Debian	2010-10-20 08:30:09 UTC (rev 5276)
@@ -1,3 +1,10 @@
+pve-manager (1.6-6) unstable; urgency=low
+
+  * on the create VM page, query capabilities of remote host (kvm/openvz
+    enabled?) and select resonable defaults.
+
+ -- Proxmox Support Team <support at proxmox.com>  Wed, 20 Oct 2010 10:27:34 +0200
+
 pve-manager (1.6-5) unstable; urgency=low
 
   * updated japanese translations

Modified: pve-manager/trunk/lib/PVE/ConfigServer.pm
===================================================================
--- pve-manager/trunk/lib/PVE/ConfigServer.pm	2010-10-18 11:52:22 UTC (rev 5275)
+++ pve-manager/trunk/lib/PVE/ConfigServer.pm	2010-10-20 08:30:09 UTC (rev 5276)
@@ -76,6 +76,9 @@
     $status->{meminfo} = PVE::Utils::get_memory_info ();   
     $status->{hdinfo}->{root} = PVE::Utils::get_hd_info ('/');   
 
+    $status->{kvmversion} = PVE::QemuServer::kvm_version();
+    $status->{openvz} = (-e '/dev/vzctl') ? 1 : 0;
+
     my $procstat = PVE::Utils::read_proc_stat();
     $status->{cpu} = $procstat->{cpu};
     $status->{wait} = $procstat->{wait};

Modified: pve-manager/trunk/www/root/vmlist/create.htm
===================================================================
--- pve-manager/trunk/www/root/vmlist/create.htm	2010-10-18 11:52:22 UTC (rev 5275)
+++ pve-manager/trunk/www/root/vmlist/create.htm	2010-10-20 08:30:09 UTC (rev 5276)
@@ -24,13 +24,15 @@
 
  my $conn = PVE::ConfigClient::connect ($udat{auth_cookie});
 
+ my $status = $conn->ping()->result;
  my $vzlist = $conn->cluster_vzlist()->result;
- my $kvmversion = $conn->kvm_version()->result;
+ my $kvmversion = $status->{kvmversion};
+ my $has_openvz = $status->{openvz};
+ my $cpuinfo = $status->{cpuinfo};
 
  my $resolvconf = PVE::Config::read_file ('resolvconf');
  my $vmops = PVE::Config::read_file ("vmops");
 
- my $cpuinfo = PVE::Utils::get_cpu_info();
 
  my $rconn = $conn;
  if ($fdat{hostcid} != $cinfo->{local}->{cid}) {
@@ -163,12 +165,22 @@
    }
  }
 
- $udat{__create_virttype} = 'openvz' if !$udat{__create_virttype};
+ # try to set some reasonable default
+ $udat{__create_virttype} = 'qemu' if $kvmversion && !$udat{__create_virttype};
+ $udat{__create_virttype} = 'openvz' if $has_openvz && !$udat{__create_virttype};
+ $udat{__create_virttype} = 'qemu' if !$udat{__create_virttype};
+
  $udat{__create_virttype} = $fdat{virttype} if $fdat{virttype} ;
  $fdat{virttype} = $udat{__create_virttype} if !$fdat{virttype};
 
  my $out = '';
 
+ if (!$has_openvz) {
+   my $msg = __("This system do not have OpenVZ in the kernel.");
+   $out .= PVE::HTMLUtils::create_noteframe (__("Attention"), $msg);
+   $out .= "<br>\n";
+ }
+
  my $has_hvm = $cpuinfo->{hvm};
  if (!$cpuinfo->{hvm}) {
    my $msg = __("This CPU does not support KVM virtual machines (no Intel VT / AMD-V support).");
@@ -192,12 +204,10 @@
 
  $out .= $form->create_header();
 
- my $vtypes = [['openvz', 'Container (OpenVZ)']];
+ my $vtypes = [];
+ push @$vtypes, ['openvz', 'Container (OpenVZ)'] if $has_openvz;
+ push @$vtypes, [ 'qemu', "Fully virtualized (KVM)" ] if $has_hvm;
 
- if ($has_hvm) {
-   push @$vtypes, [ 'qemu', "Fully virtualized (KVM)" ];
- }
-
  $grid->add_row (__("Type") . ':',
 		 $form->create_element ('virttype', 'dynamicdropdown',
 					$fdat{virttype}, $vtypes),




More information about the pve-devel mailing list