title: VagrantFile execution on vagrant destroy
body: <p>Every time you call <code>vagrant up</code> or <code>vagrant destroy</code> VagrantFile gets executed?</p>
  
  <p>It's because I'm having the following problem. On <code>vagrant up</code> I configure the machine with the following parameters:</p>
  
  <pre><code>config.vm.provision "chef_client" do |chef|
      chef.node_name = 'living-dev-'+Time.new.strftime("%H%M%S")
      config.vm.hostname = chef.node_name
  end
  </code></pre>
  
  <p>When I execute <code>vagrant destroy</code> the following code executes:</p>
  
  <pre><code>config.trigger.after :destroy do
      info "Attempting to remove node #{config.vm.hostname}"
      run "knife node show #{config.vm.hostname} -c c:/chef/knife.rb"
      if $?.to_i == 0
          info "Removing node #{config.vm.hostname}"
          "knife node delete #{config.vm.hostname} -y -c c:/chef/knife.rb"
      end
  end
  </code></pre>
  
  <p>The <strong>config.vm.hostname</strong> that I obtain here is diferent that the one defined on chef, so I'm not able to remove the vm machine on chef server.</p>
  
  <p>How I can solve it?</p>