vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Destroying a guest from global status does not work

Open chrisroberts opened this issue 3 years ago • 1 comments

vagrant global-status will output the id of target (among some other information). For example:

% ./vagrant global-status

  id       
  name   
  provider   
  state   
  directory                           
  
  -----------------------------------------------------------------------
  f154b77  
  a      
  virtualbox 
  running 
  /Users/sophia/project/vagrant-ruby 

In this case, the output id is f154b77. Running a vagrant destroy f154b77 should destroy the machine. Instead it returns an error:

% ./vagrant destroy f154b77

! Running of task destroy failed unexpectedly
  
! Error: rpc error: code = NotFound desc = record not found for Target (name: f154b77 resource_id: f154b77)

This fails because the resource_id is truncated in the global-status output. Instead, inspecting the bolt db the resource id is f154b773-bef0-4139-8bdb-5a8b7253b21f.

chrisroberts avatar Aug 29 '22 21:08 chrisroberts

This is probably fixed (or close to fixed) by https://github.com/hashicorp/vagrant/pull/12904/

soapy1 avatar Oct 05 '22 19:10 soapy1