-
Notifications
You must be signed in to change notification settings - Fork 38
vagrant up powers on already running vm? #51
Comments
Seems to be this code here: # This action starts a VM, assuming it is already imported and exists.
# A precondition of this action is that the VM exists.
def self.action_start
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use ConnectVCloud
b.use Call, IsRunning do |env, b2|
# If the VM is running, then our work here is done, exit
if env[:result]
b2.use MessageAlreadyRunning
next
end
end
b.use Call, IsPaused do |env, b2|
if env[:result]
b3.use Resume
next
end
end
b.use PowerOn
end
end The both |
I'm wrong. A 'return' would hurt more. I have read through some docs and especially Mitchs middleware https://github.com/mitchellh/middleware/blob/master/user_guide.md All the functions in action.rb build a stack that will be called afterwards. So we have to move the PowerOn inside some if/else block like other plugins do. I have compared vagrant-aws and vagrant-azure which both also work in parallel mode as well. That would be a good starting point to clean up this action.rb. |
Can you test this patch ? I think our reasoning is too complex for this task, Thanks in advance, |
Hi @tsugliani, yes, this works fine. Second vm is started, first one (already) running ist skipped. |
* upstream/develop: Debug formatting fixes, avoid unwanted \n Rubocop fixes Fixes frapposelli#51 - Do not PowerOn already Powered On machines, and simplify action_start
Just another strange situation. I have powered up two of four VM's in a vApp.
Then checking with status and vcloud-status to see starting point as shown below.
After that another vagrant up shows me already running messages, but also a Powering up message for the two already running boxes.
Could we skip this Powering on if box is already running?
I think, host names or other guest customization steps could be skipped in this situation?
The text was updated successfully, but these errors were encountered: