Changeset 755 in ProjectBuilder
- Timestamp:
- Apr 3, 2009, 4:19:09 PM (15 years ago)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r754 r755 1435 1435 1436 1436 foreach my $v (@$vm) { 1437 # Launch the VM/VE 1437 # Launch VM/VE 1438 ($vmexist,$vmpid) = pb_launchv($vtype,$v,0,$snapme); 1439 1438 1440 if ($vtype eq "vm") { 1439 ($vmexist,$vmpid) = pb_launchv($vtype,$v,0,$snapme);1440 1441 pb_log(2,"DEBUG: After pb_launchv, vmexist: $vmexist, vmpid: $vmpid\n"); 1441 1442 … … 1465 1466 my $vtype = shift; 1466 1467 my $v = shift; 1467 my $create = shift || 0; # By default do not create a VM 1468 my $snapme = shift || 0; # By default do not create a VM1468 my $create = shift || 0; # By default do not create a VM/VE 1469 my $snapme = shift || 0; # By default do not snap a VM/VE 1469 1470 1470 1471 pb_log(2,"DEBUG: pb_launchv($vtype,$v,$create)\n"); … … 1497 1498 $ENV{'PBVMOPT'} .= " $vmopt->{$ENV{'PBPROJ'}}" if ($ENV{'PBVMOPT'} !~ / $vmopt->{$ENV{'PBPROJ'}}/); 1498 1499 } 1499 # Do not use snapshot feature at creation1500 if ($create != 0) {1500 # Use snapshot feature when not creating VM 1501 if ($create == 0) { 1501 1502 if ((defined $vmsnap->{$v}) && ($vmsnap->{$v} =~ /true/i)) { 1502 1503 $ENV{'PBVMOPT'} .= " -snapshot"; … … 1584 1585 # Get VE context 1585 1586 my ($ptr,$vetmout,$vepath,$verebuild,$veconf,$vepostinstall) = pb_conf_get("vetype","vetmout","vepath","verebuild","veconf"); 1586 my ($veb4pi,$vepi,$vepkglist ) = pb_conf_get_if("veb4pi","vepi","vepkglist");1587 my ($veb4pi,$vepi,$vepkglist,$vesnap) = pb_conf_get_if("veb4pi","vepi","vepkglist","vesnap"); 1587 1588 my $vetype = $ptr->{$ENV{'PBPROJ'}}; 1588 1589 … … 1653 1654 } 1654 1655 } 1656 # Test if an existing snapshot exists and use it if appropriate 1657 # And also use it of no local extracted VE is present 1658 if ((-f "$vepath->{$ENV{'PBPROJ'}}/$ddir-$dver-$darch.tar.gz") && 1659 (((defined $vesnap->{$v}) && ($vesnap->{$v} =~ /true/i)) || 1660 ((defined $vesnap->{$ENV{'PBPROJ'}}) && ($vesnap->{$ENV{'PBPROJ'}} =~ /true/i)) || 1661 ($pbsnap eq 1) || 1662 (! -d "$vepath->{$ENV{'PBPROJ'}}/$ddir/$dver/$darch"))) { 1663 pb_system("sudo mkdir -p $vepath->{$ENV{'PBPROJ'}}/$ddir/$dver/$darch ; sudo tar xz -C $vepath->{$ENV{'PBPROJ'}}/$ddir/$dver/$darch -f $vepath->{$ENV{'PBPROJ'}}/$ddir-$dver-$darch.tar.gz","Extracting snapshot of $ddir-$dver-$darch.tar.gz under $vepath->{$ENV{'PBPROJ'}}/$ddir/$dver/$darch"); 1664 } 1655 1665 # Nothing more to do for VE. No real launch 1656 1666 } else { … … 1785 1795 chmod 0755,"$ENV{'PBDESTDIR'}/pbscript"; 1786 1796 1797 # Launch the VM/VE 1798 ($vmexist,$vmpid) = pb_launchv($vtype,$v,0); 1799 1787 1800 if ($vtype eq "vm") { 1788 # Launch the VM1789 ($vmexist,$vmpid) = pb_launchv($vtype,$v,0);1790 1791 1801 # Skip that VM if it something went wrong 1792 1802 next if (($vmpid == 0) && ($vmexist == 0)); … … 1984 1994 EOF 1985 1995 1996 # Launch the VM/VE 1997 ($vmexist,$vmpid) = pb_launchv($vtype,$v,0); 1998 1986 1999 if ($vtype eq "vm") { 1987 2000 # Prepare the key to be used and transfered remotely … … 1992 2005 $nport = "$pbport" if (defined $pbport); 1993 2006 1994 # Launch the VM1995 ($vmexist,$vmpid) = pb_launchv($vtype,$v,0);1996 1997 2007 # Skip that VM if something went wrong 1998 2008 next if (($vmpid == 0) && ($vmexist == 0)); … … 2164 2174 print SCRIPT << "EOF"; 2165 2175 # This is needed in order to be able to halt the machine from the $pbac->{$ENV{'PBPROJ'}} account at least 2166 print PBOUT "Defaults:pb env_keep += \ "http_proxy ftp_proxy\"\n";2176 print PBOUT "Defaults:pb env_keep += \\\"http_proxy ftp_proxy\\\"\n"; 2167 2177 print PBOUT "$pbac->{$ENV{'PBPROJ'}} ALL=(ALL) NOPASSWD:ALL\n"; 2168 2178 EOF -
projects/qemu/.pbrc
r726 r755 2 2 # Valid values for vmtype are 3 3 # qemu, kvm, (xen, ... TBD) 4 vmtype default = kvm4 vmtype default = qemu 5 5 6 6 # Hash for VM stuff on vmtype … … 14 14 vmlogin default = pb 15 15 vmport default = 2222 16 vmmonport default = 4444 16 17 17 18 # Timeout to wait when VM is launched/stopped … … 33 34 vmsize default = 7G 34 35 36 # Do we use snapshot mode for VMs ? 37 # In which case ll modifs in the VM are lost at the end 38 #vmsnap default = true 39 35 40 # 36 41 # For Virtual machines management
Note:
See TracChangeset
for help on using the changeset viewer.