[pve-devel] r6380 - in pve-storage/pve2: . PVE/API2/Storage

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Jul 29 07:42:35 CEST 2011


Author: dietmar
Date: 2011-07-29 07:42:35 +0200 (Fri, 29 Jul 2011)
New Revision: 6380

Modified:
   pve-storage/pve2/ChangeLog
   pve-storage/pve2/PVE/API2/Storage/Config.pm
Log:
	* PVE/API2/Storage/Config.pm: activate base storage before we try
	to create the VG. Make 'nodes' optional.



Modified: pve-storage/pve2/ChangeLog
===================================================================
--- pve-storage/pve2/ChangeLog	2011-07-29 04:48:44 UTC (rev 6379)
+++ pve-storage/pve2/ChangeLog	2011-07-29 05:42:35 UTC (rev 6380)
@@ -1,3 +1,8 @@
+2011-07-29  Proxmox Support Team  <support at proxmox.com>
+
+	* PVE/API2/Storage/Config.pm: activate base storage before we try
+	to create the VG. Make 'nodes' optional.
+
 2011-07-28  Proxmox Support Team  <support at proxmox.com>
 
 	* PVE/Storage.pm (storage_check_node): check if storage is

Modified: pve-storage/pve2/PVE/API2/Storage/Config.pm
===================================================================
--- pve-storage/pve2/PVE/API2/Storage/Config.pm	2011-07-29 04:48:44 UTC (rev 6379)
+++ pve-storage/pve2/PVE/API2/Storage/Config.pm	2011-07-29 05:42:35 UTC (rev 6380)
@@ -108,7 +108,7 @@
     	additionalProperties => 0,
 	properties => { 
 	    storage => get_standard_option('pve-storage-id'),
-	    nodes => get_standard_option('pve-node-list'),
+	    nodes => get_standard_option('pve-node-list', { optional => 1 }),
 	    type => { 
 		type => 'string', 
 		enum => $storage_type_enum,
@@ -202,11 +202,19 @@
 			die "unsupported base type '$basecfg->{type}'";
 		    }
 
-		    my $path =  PVE::Storage::path ($cfg, $opts->{base});
+		    my $path = PVE::Storage::path ($cfg, $opts->{base});
 
+		    PVE::Storage::activate_storage($cfg, $baseid);
+
 		    PVE::Storage::lvm_create_volume_group ($path, $opts->{vgname}, $opts->{shared});
 		}
-	
+
+		# try to activate if enabled on local node,
+		# we only do this to detect errors/problems sooner
+		if (PVE::Storage::storage_check_enabled($cfg, $storeid, undef, 1)) {
+		    PVE::Storage::activate_storage($cfg, $storeid);
+		}
+
 		cfs_write_file('storage.cfg', $cfg);
 	    
 	    }, "create storage failed");
@@ -223,7 +231,7 @@
     	additionalProperties => 0,
 	properties => { 
 	    storage => get_standard_option('pve-storage-id'),
-	    nodes => get_standard_option('pve-node-list'),
+	    nodes => get_standard_option('pve-node-list', { optional => 1 }),
 	    content => {
 		type => 'string', format => 'pve-storage-content-list',
 		optional => 1,




More information about the pve-devel mailing list