diff --git a/apt/manage_instance.in b/apt/manage_instance.in index a0e092a2d024a017732e26cf9924b7d813be3d9e..66149da7d888cbc09667f3bb924caa0e3294345b 100644 --- a/apt/manage_instance.in +++ b/apt/manage_instance.in @@ -301,6 +301,7 @@ sub DoSnapshot() "slice_urn" => $slice->urn(), "imagename" => $imagename, "sliver_urn" => $sliver_urn, + "global" => 1, "credentials" => [$slice_credential->asString(), $speaksfor_credential->asString()], }; diff --git a/backend/newimageid_ez.in b/backend/newimageid_ez.in index 38c9238e4a7db3b5dc9fe91d7ae5c2438c11c89d..b973a7a5f59e2f21527086658457ad56d7af3c11 100644 --- a/backend/newimageid_ez.in +++ b/backend/newimageid_ez.in @@ -1,6 +1,6 @@ #!/usr/bin/perl -wT # -# Copyright (c) 2000-2014 University of Utah and the Flux Group. +# Copyright (c) 2000-2015 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -517,7 +517,7 @@ if (!exists($newimageid_args{"path"}) || elsif (! $isadmin) { my $pdef = ""; - if (!$shared && + if (!($shared || $global) && exists($newimageid_args{"gid"}) && $newimageid_args{"gid"} ne "" && $newimageid_args{"gid"} ne $newimageid_args{"pid"}) { @@ -711,8 +711,8 @@ $newimageid_args{"ezid"} = 1; # OSInfo->Create args not quite the same as Image->Create ones so copy # newimageid_args into a new hash and fix up values. my %newosid_args = %newimageid_args; -$newosid_args{"shared"} = $newimageid_args{"global"} - if exists $newimageid_args{"global"}; +$newosid_args{"shared"} = $newimageid_args{"global"} = 1 + if ($global); my $usrerr; my $new_osinfo = OSinfo->Create($project, $this_user, $imagename, \%newosid_args, \$usrerr); diff --git a/utils/clone_image.in b/utils/clone_image.in index cbe5202bd97bb0c3ced02d21c15283db03d655f9..5c3db0fbb752d3d6c52882d0630c91f4ca654d6b 100644 --- a/utils/clone_image.in +++ b/utils/clone_image.in @@ -65,8 +65,8 @@ my $nosnapshot = 0; my $isvirtnode = 0; my $waitmode = 0; my $nodelta = 0; # To pass to create_image. -my $global; -my $shared; +my $global = 0; +my $shared = 0; # # Configure variables @@ -376,8 +376,9 @@ if (Image->LookupByName($imagename) && !$this_user->IsAdmin()) { fatal("Not allowed to shadow snapshot a system image"); } -# Subgroups change the path -my $path = ($experiment->pid() eq $experiment->gid() ? +# Subgroups change the path, but a global image should still +# go into the project image directory. +my $path = ($experiment->pid() eq $experiment->gid() || $global ? "$PROJROOT/$pid/images/${imagename}.ndz" : "$GROUPROOT/$pid/$gid/images/${imagename}.ndz"); @@ -405,10 +406,10 @@ $xmlfields{"reboot_waittime"} = $base_osinfo->reboot_waittime() $xmlfields{"osfeatures"} = $base_osinfo->osfeatures() if (defined($base_osinfo->osfeatures()) && $base_osinfo->osfeatures() ne ""); -if (defined($global) && $global) { +if ($global) { $xmlfields{"global"} = 1; } -elsif (defined($shared) && $shared) { +elsif ($shared) { $xmlfields{"shared"} = 1; }