title: Access machine ID from trigger
body: <p>I want a trigger (via the <a href="https://github.com/emyl/vagrant-triggers" rel="nofollow noreferrer"><code>vagrant-triggers</code> plugin</a>) to be active only for the Virtualbox provider. In this case, a second virtual disk should be removed from the machine configuration. Below is an excerpt of my <code>Vagrantfile</code>:</p>
  
  <pre><code>VAGRANTFILE_API_VERSION = "2"
  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.provider "virtualbox" do |vb, override|
      # Use VBoxManage to customize the VM. For example to change memory:
      vb.customize ["modifyvm", :id, "--memory", "1536"]
  
      override.trigger.after :halt, :append_to_path =&gt; ENV["VBOX_INSTALL_PATH"] do
        run "VBoxManage storageattach " +
          File.read(".vagrant/machines/default/virtualbox/id") +
          " --storagectl SATA --port 1 --medium none"
      end
    end
  end
  </code></pre>
  
  <p>In the example above, I can use <code>:id</code> to refer to the machine ID when setting the memory size; but I have only found an adventurous hack in <a href="https://stackoverflow.com/a/20860087/946850">this answer</a> to get hold of the machine ID in the <code>after</code> trigger.</p>
  
  <p>It seems I can only use <code>run</code> methods in a trigger definition, calling <code>customize</code> doesn't work. Is there a better way to access the machine ID in a trigger?</p>