Skip to content

watsonlu/hyperv-cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyperv-cookbook

This cookbook allows you to handle basic hyper-v operations using chef

###Recipes and Attributes

###Create Recipe

The Create recipe accepts a hash of VM's to create using the following attributes:

Your attributes should look something like this:

Example run_list:

switch "my virtual switch",
vm_list = [
  {
    "name" => "TestVM1",
    "memory" => "8GB",
    "source_vhd" => "http:// or C:\",
    "destination_vhd" => "C:\\\\disk.vhd"
  },
  {
    "name" => "TestVM2",
    "memory" => "8 GB",
    "source_vhd" => "http:// or C:\",
    "vhd" => "C:\\disk2.vhd"
  }
]

The recipe will loop through each VM in the VM_List and create that VM. It will not start the VM's, use the start recipe for that.

###Start Recipe

Starts the VM that is in the "name" attribute.

node["hyperv"]["name"]

###Stop Recipe

Stops the VM with the "name" attribute. No attributes required other than "name".

You can set the "name" attribute to "" to stop all VM's, or "Name" to stop some VM's.

node["hyperv"]["name"]

###Remove Recipe

No attributes required other than "name". This will not delete the VHD

node["hyperv"]["name"]

###Remove Recipe

No attributes required other than "name". This will remove the VM and its associated VHD so be careful.

Use ::Remove if you just want to remove it from hyperv and keep the data

node["hyperv"]["name"]

###Shutdown Recipe

Shut's down any VM with the "name" attribute. You can set ["hyperv"]["shutdown"]["force"] to "true" to have it force a shutdown, otherwise it will shudown slowly in the guest.

node["hyperv"]["name"]

About

A cookbook to manage hyperv vm's using chef

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages