A generic ‘vm’ instance to define an individual vm, for example, as provisioned on a hypervisor zone from an OnApp CP, or on a more generic interface such as to RackSpace OpenStack or EC2.
In the future this will likely be split into Compute, Storage, Network as per OCCI
Generic VM type
number of CPUs assigned to the VM.
set the disk space for this VM
set the host name for this VM.
amount of RAM assigned to the VM.
set 1 if you need automatic backups.
set “1” if you want IP address to be assigned automatically after creation. Otherwise set “0”
set 1 to build VM automatically
set 1 to start up the VM automatically, otherwise set 0 (default state is “1”)
set swap space. There is no swap disk for Windows-based VMs
Create a generic VM resource
hash - Hash of attributes to apply
type - type for serialization help
# File lib/onapp_market/instance/vm.rb, line 39 def initialize(hash = {}, type = nil) type = TYPE if type == nil super(hash, type) end
Restart a VM
OnappMarket::API::Response - VM has been shutdown if is_ok?
trader, admin
# File lib/onapp_market/instance/vm.rb, line 70 def backup @api.get("/vm/#{self.instance_id}/backup") end
Restart a VM
OnappMarket::API::Response - VM has been shutdown if is_ok?
trader, admin
# File lib/onapp_market/instance/vm.rb, line 60 def restart @api.get("/vm/#{self.instance_id}/restart") end
Restart a VM
OnappMarket::API::Response - VM has been shutdown if is_ok?
trader, admin
# File lib/onapp_market/instance/vm.rb, line 80 def restore @api.get("/vm/#{self.instance_id}/restore") end
Shutdown a VM
OnappMarket::API::Response - VM has been shutdown if is_ok?
trader, admin
# File lib/onapp_market/instance/vm.rb, line 50 def shutdown @api.get("/vm/#{self.instance_id}/shutdown") end