ok grep ({$_->name eq $vol->name} @vols), 'list_volumes';
my ($debian) = grep { $_->name =~ /debian jessie/i } $sw->images;
-my $srv = $sw->create_server('mysrv', $org, $debian, {1 => {%$vol}});
+my $srv = $sw->create_server('mysrv', $org, $debian, {1 => $vol->id});
note "Created new server $srv with name ", $srv->name;
is $sw->server($srv)->name, $srv->name, 'get_server';
$srv->{name} = 'testsrv';
#$sw->update_snapshot($snp);
#is $sw->snapshot($snp)->name, $snp->name, 'update_snapshot';
-sleep 20;
-
+@vols = map { $_->{id} } values %{$srv->volumes};
$sw->delete_server($srv);
$sw->delete_ip($ip);
-$sw->delete_volume($vol);
+$sw->delete_volume($_) for @vols;