Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snyn fork #2

Merged
merged 10 commits into from
Sep 24, 2014
Merged

Snyn fork #2

merged 10 commits into from
Sep 24, 2014

Conversation

rylarson
Copy link
Owner

No description provided.

Ryan Larson and others added 10 commits September 19, 2014 12:59
This is very similar to the -cvlan capability that knife-vsphere gives you.

== DETAILS

-Added a new configuration option 'vlan' that lets you specify the vlan string
-If vlan is set, the clone spec is modified with an edit action to connect the first NIC on the VM to the configured VLAN.
Add vlan option to README
-If the VM is powered on, then it is powered off, and destroyed.
-If the VM is powered off, it is just destroyed.
-If the VM is suspended, it is powered on, then powered off, then destroyed.
   -This feels weird, but the vsphere API docs state that calling power off on a vm in any other state besides poweredOn will throw an exception.
   -Also, the Destroy_Task documentation and the VirtualMachine documentation don't specify what state the VM has to be in before it is destroyed.
   -Since the current implementation tries to make sure it is powered off before it is destroyed, I am making sure to do the same if the VM is suspended.

== DETAILS

-I refactored the VM state stuff into a common module called VmHelpers. The get_state action now uses this for getting the machine state, and most of the common vm tasks
are wrapped by this class.
-Basically what we are doing here is making the power_off action idempotent, and I toyed with the idea of making idempotent wrapper methods in VmHelpers, but decided that
VmHelpers should just deal with interacting with the VM and let the actions themselves enforce idempotency if they wish.
rylarson added a commit that referenced this pull request Sep 24, 2014
@rylarson rylarson merged commit a82ae6e into rylarson:master Sep 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants