Class Xen::Vm
In: lib/xen/vm.rb
Parent: Object

Methods

Attributes

uid  [R] 

Public Class methods

Creates a new VM, Given the VM‘s UID and the host it is running on.

Public Instance methods

Reboots the VM in a clean way, and returns the current state

Shuts down the VM in a clean way, and returns the current state

Hard reboots the VM, and returns the current state

Shuts down the VM immediatly, hard, and returns the current state

Returns true if the current vm happens to be dom0.

Returns the VM‘s name

Pauses the VM, and returns the current state

Record..

Starts a VM, and returns the current state

Gets the state of the VM. The first time it is called it query‘s the server, other times it is cached. There is an optional parameter ‘refresh’ which, when true, will re-query the server.

Example

  # Having vm being a new initiated Vm
  vm.state # => "Running"
  vm.clean_shutdown! # => "Running"
  # We wait a while
  vm.state # => "Running" (cached)
  vm.state(true) # => "Halted"

Unpauses the VM, and returns the current state

Returns the VM‘s uuid

[Validate]