Coder Social home page Coder Social logo

fission's Introduction

Fission

Build Status Dependency Status

Intro

Fission is a simple command line tool for managing VMware Fusion VMs. Only Fusion 3.x is currently supported. See Fusion Version Support for more info.

Install

gem install fission

Usage

Clone

fission clone existing_vm new_vm [--start]

If you provide '--start', then the new VM will be powered on after cloning

Delete

fission delete my_vm [--force]

Deletes the VM. This will delete the files from disk and remove the related metadata in Fusion.

By default, the VM will not be deleted if:

  • The VM is running
  • The Fusion GUI is running (as the metadata cannot be cleanly removed)

Providing '--force' will:

  • Stop the VM if it's running
  • Delete the VM even if the Fusion GUI is running

Info

fission info my_vm

Outputs information about the VM

Snapshot Create

fission snapshot create my_vm snapshot_name

Creates a snapshot for the VM

In order to create the snapshot:

  • The VM must be running
  • The snapshot name must be unique

Snapshot Delete

fission snapshot delete my_vm snapshot_name

Deletes a snapshot for the VM

If you have the Fusion GUI running, the VM must be running in order to delete the snapshot.

Snapshot List

fission snapshot list my_vm

Lists the snapshots for the VM

Snapshot Revert

fission snapshot revert my_vm existing_snapshot

Reverts a VM to an existing snapshot

In order to revert to the snapshot:

  • The Fusion GUI cannot be running

Start

fission start my_vm [--headless]

Starts the VM

Providng '--headless' will start the VM without a Fusion GUI console

Note that the Fusion GUI cannot be running to start a VM with '--headless'

Status

fission status

Displays the status (running or not) of all of the VMs found

Stop

fission stop my_vm

Stops the VM

Suspend

fission suspend [my_vm | --all]

Suspends the VM or all running VMs

Help

fission -h

or just

fission

Configuration

By default, fission will use the default VMware Fusion VM directory (~/Documents/Virtual Machines.localized/) when cloning. If you want to use a different directory, you can set this in a config file.

The config file needs to be in YAML format and live at '~/.fissionrc'

$cat ~/.fissionrc
---
vm_dir: "/vm"

Fusion Version Support

As of now, only Fusion 3.x is supported (that's what I have available to test). It's my understanding that some folks are currently using fission with Fusion 4.x as well. In order to have fission work with Fusion 4.x, you will need to tell fission where the Fusion 4.x vmrun file is. You can do so with the following item placed in your ~/.fissionrc (remember, YAML format):

vmrun_bin: /Applications/VMware Fusion.app/Contents/Library/vmrun

Other Notable Info

The name of the VM used in the previous examples should be the directory name of the VM minus the '.vmwarevm' extension. Typically the VM name and the directory name are the same.

As of now, VMware Fusion doesn't provide an easy, out of the box, way to modify the personality (hostname, ip, etc.) of a VM. Because of this, a clone created by fission is an exact copy of the original (including hostname, ip address, etc.). Most likely, this isn't what you want.

One approach is to create a VM which will act as a template. Create the VM with the desired install method (ideally with easy install) and settings, but do not power on the VM. You can then create clones from this VM 'template'. When you power on the clone, it will start the OS install process (and assign a new ip, etc.).

Fission with RVM

Please see the following gist for a walkthrough of making fission available regardless of ruby environment when using RVM https://gist.github.com/1203167

Contribute

  • Fork the project
  • Make your feature addition or bug fix (with tests and docs) in a topic branch
  • Bonus points for not mucking with the gemspec or version
  • Send a pull request and I'll get it integrated

License

See LICENSE

fission's People

Contributors

calavera avatar ody avatar patdowney avatar sferik avatar taliesins avatar thbishop avatar wayneeseguin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fission's Issues

License missing from gemspec

RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.

There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!

Appendix:

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies

p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.

No longer functional under Ruby 1.8.7

Commit 0a4be1f removes fission's compatibility with Ruby 1.8.7 with the use of the key method. Since I am using fission as a library to add function to other Ruby projects that are staying compatible with both, 1.8.7 and 1.9.2 it would be advantageous and appreciated to stay compatible with both.

VMware Fusion 5 Support

Operating through veewee, VMware Fusion 5.0.2 Professional behaves as expected with fission as written. The one exception is VM deletion which returns the following error because the properties list for Fusion changed with version 5:

fission-0.4.0/lib/fission/metadata.rb:88:in `delete_vm_favorite_entry': undefined method `delete_if' for nil:NilClass (NoMethodError)
    from fission-0.4.0/lib/fission/metadata.rb:27:in `delete_vm_info'
    from fission-0.4.0/lib/fission/vm.rb:675:in `delete'

The underlying files are removed, but the metadata isn't erased leaving the VM in the Fusion Virtual Machine Library list. Time allowing, I will try to investigate a solution and submit a pull request accordingly.

Hashinize the conf_file

Looking at extracting a bit more information out of the vmx files that represent each vm. With the intention of using that information in Fog and matching as closely as possible to the attribute data we extracted for the vSphere provider, https://github.com/fog/fog/blob/master/lib/fog/vsphere/models/compute/server.rb#L20-L36. Worth establishing a way to get arbitrary data out of the vmx rather than making extra methods that will just look like network_info one but with a different regex?

Starting VMs in headless mode hangs.

When launching VMs in headless mode with Fusion 3, Ruby hangs. Hang is avoided when I modify fission to redirect vmrun commands' stdout to /dev/null

Step 1: Hangs

http://dl.dropbox.com/u/33985079/Screen%20Shot%202011-12-07%20at%201.54.04%20PM.png

Step 2: Kill VM manually using vmrun in right terminal. You will see the method in left terminal finally return.

http://dl.dropbox.com/u/33985079/Screen%20Shot%202011-12-07%20at%201.54.21%20PM.png

This actually seems to be a problem with vmrun its self in conjunction with Ruby leaving stdout IO open but never retrieving anything properly. Vmrun does actually start the process, you can see it in the process table when the vm.start hangs.

Step 1: Start with vmrun in left terminal. This exits normally.

http://dl.dropbox.com/u/33985079/Screen%20Shot%202011-12-07%20at%201.45.07%20PM.png

Step 2: Stop with vmrun in right terminal. Logging for the stop ends up in left terminal.

http://dl.dropbox.com/u/33985079/Screen%20Shot%202011-12-07%20at%201.45.20%20PM.png

fission start does not work with VMWare Fusion 4

fission start VMNAME implicitly refers to /Library/Application Support/VMware Fusion/vmrun VMWare utility to start a given VM. However, since VMWare Fusion 4, vmrun is now part of the VMWare Fusion.app bundle (whose current path is /Applications/VMware Fusion.app/Contents/Library/vmrun), causing the following error to the fission startcommand:

Starting 'FOO_VM'
sh: /Library/Application Support/VMware Fusion/vmrun: No such file or directory
There was a problem starting the VM.  The error was:

So, the current best workaround this issue is to create a file named .fissionrc at your home directory (~/.fissionrc) with the following content:

vmrun_bin: "/Applications/VMware Fusion.app/Contents/Library/vmrun"

This will override the default settings at fission/config.rb file.

Feature: Allow operations on multiple vms

I propose that anywhere where you're supplying a VM name for any of the command line operations, that you can choose to supply a comma-separated string of VMs to perform operations on multiple VMs at once.

Support JRuby on windows patch

Please can the dependency on CFPropertyList be upgraded to a newer version. Old versions require libxml and this breaks jruby on my windows box. Newer versions of CFProperty make libxml an optional dependency.

I am using fission for fog and fog for veewee.

In gemspec

Change:
s.add_dependency 'CFPropertyList', '~> 2.0.17'

To:
s.add_dependency 'CFPropertyList', '~> 2.1.1'

Release version 0.5

Thanks for merging in all my patches. Is there anything else holding up the 0.5.0 release? I noticed you pushed 0.5.0.beta.1 back in June. It does look like there have been any bug reports with the beta, so maybe it’s time for a final release?

Duplicate entries in .vmx when cloning a clone

Duplicate entries for 'uuid.action' and 'tools.remindInstall' are created in the vmx file when cloning a clone.

This:

fission clone c5u7 test_clone

Produces:

cat /vm/test_clone.vmwarevm/test_clone.vmx | grep -E "tools.remind|uuid.action"
tools.remindInstall = "FALSE"
uuid.action = "create"

And then this:

fission clone test_clone test_clone_2

Produces:

cat /vm/test_clone_2.vmwarevm/test_clone_2.vmx | grep -E "tools.remind|uuid.action"
tools.remindInstall = "FALSE"
uuid.action = "create"
tools.remindInstall = "FALSE"
uuid.action = "create"

moved/renamed vms are not found

I have a VMs that have been copied from another machine and renamed. 'fission status' lists by directory name (within Documents/Virtual Machines.localized/), but the .vmx files within those directories do not match the directory names. For example:

Documents/Virtual Machines.localized/ubuntu2-1004.vmwarevm/ubuntu2-1004.vmx
does not exist but
Documents/Virtual Machines.localized/ubuntu2-1004.vmwarevm/Ubuntu1-10.04.vmx
does.

My naive impression is that looking for Documents/Virtual Machines.localized/ubuntu2-1004.vmwarevm/*vmx should work since my directories only contain a single vmx file each.

.fissionrc not applied

I noticed that my .fissionrc didn't seem to be working.

It looks like we're reading it first, then setting the defaults over it.

rspec 3 compatibility

Failures:
one test fails when run with rspec 3, all tests pass with rspec 2

  1. Fission::Action::ShellExecutor execute should return a hash of the output and Process::Status object
    Failure/Error: result['output'].empty?.should be_false
    expected false to respond to false?

    ./spec/fission/action/execute_shell_command_spec.rb:19:in `block (3 levels) in <top (required)>'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.