Revision c8d4f054 src/oca/ruby/OpenNebula/VirtualMachine.rb

View differences:

src/oca/ruby/OpenNebula/VirtualMachine.rb
10 10
            :allocate => "vm.allocate",
11 11
            :action   => "vm.action",
12 12
            :migrate  => "vm.migrate",
13
            :deploy   => "vm.deploy"
13
            :deploy   => "vm.deploy",
14
            :savedisk => "vm.savedisk"
14 15
        }
15 16

  
16 17
        VM_STATE=%w{INIT PENDING HOLD ACTIVE STOPPED SUSPENDED DONE FAILED}
......
167 168

  
168 169
            return rc
169 170
        end
171
        
172
        def save_as(disk_id, image_id)
173
            return Error.new('ID not defined') if !@pe_id
174

  
175
            rc = @client.call(VM_METHODS[:savedisk], @pe_id, disk_id, image_id)
176
            rc = nil if !OpenNebula.is_error?(rc)
177

  
178
            return rc
179
        end
170 180

  
171 181
        #######################################################################
172 182
        # Helpers to get VirtualMachine information

Also available in: Unified diff