diff --git a/lib/fog/compute/google/models/server.rb b/lib/fog/compute/google/models/server.rb index 2555ef349..21019f3ca 100644 --- a/lib/fog/compute/google/models/server.rb +++ b/lib/fog/compute/google/models/server.rb @@ -339,10 +339,10 @@ def start(async = true) operation end - def stop(async = true) + def stop(async = true, discard_local_ssd=false) requires :identity, :zone - data = service.stop_server(identity, zone_name) + data = service.stop_server(identity, zone_name, discard_local_ssd) operation = Fog::Compute::Google::Operations .new(:service => service) .get(data.name, data.zone) diff --git a/lib/fog/compute/google/requests/stop_server.rb b/lib/fog/compute/google/requests/stop_server.rb index f40052a2b..86c485b73 100644 --- a/lib/fog/compute/google/requests/stop_server.rb +++ b/lib/fog/compute/google/requests/stop_server.rb @@ -10,8 +10,8 @@ def stop_server(_identity, _zone) end class Real - def stop_server(identity, zone) - @compute.stop_instance(@project, zone.split("/")[-1], identity) + def stop_server(identity, zone, discard_local_ssd=false) + @compute.stop_instance(@project, zone.split("/")[-1], identity, discard_local_ssd: discard_local_ssd) end end end diff --git a/test/integration/compute/core_compute/test_servers.rb b/test/integration/compute/core_compute/test_servers.rb index e8d0ec534..111fd8a91 100644 --- a/test/integration/compute/core_compute/test_servers.rb +++ b/test/integration/compute/core_compute/test_servers.rb @@ -132,6 +132,18 @@ def test_start_stop_reboot assert server.ready? end + def test_start_stop_discard_local_ssd + server = @factory.create + + async = true + discard_local_ssd = true + + server.stop(async, discard_local_ssd) + server.wait_for { stopped? } + + assert server.stopped? + end + def test_attach_disk # Creating server server = @factory.create