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

View differences:

src/oca/ruby/OpenNebula/VirtualMachine.rb
98 98
        # XML-RPC Methods for the Virtual Machine Object
99 99
        #######################################################################
100 100

  
101
        # Retrieves the information of the given VirtualMachine.
101 102
        def info()
102 103
            super(VM_METHODS[:info], 'VM')
103 104
        end
104

  
105
        
106
        # Allocates a new VirtualMachine in OpenNebula
107
        #
108
        # +description+ A string containing the template of the VirtualMachine.
105 109
        def allocate(description)
106 110
            super(VM_METHODS[:allocate],description)
107 111
        end
108

  
112
        
113
        # Initiates the instance of the VM on the target host.
114
        #
115
        # +host_id+ The host id (hid) of the target host where
116
        # the VM will be instantiated.
109 117
        def deploy(host_id)
110 118
            return Error.new('ID not defined') if !@pe_id
111 119

  
......
115 123
            return rc
116 124
        end
117 125

  
126
        # Shutdowns an already deployed VM
118 127
        def shutdown
119 128
            action('shutdown')
120 129
        end
121 130

  
131
        # Cancels a running VM
122 132
        def cancel
123 133
            action('cancel')
124 134
        end
125 135

  
136
        # Sets a VM to hold state, scheduler will not deploy it
126 137
        def hold
127 138
            action('hold')
128 139
        end
129 140

  
141
        # Releases a VM from hold state
130 142
        def release
131 143
            action('release')
132 144
        end
133 145

  
146
        # Stops a running VM
134 147
        def stop
135 148
            action('stop')
136 149
        end
137 150

  
151
        # Saves a running VM
138 152
        def suspend
139 153
            action('suspend')
140 154
        end
141 155

  
156
        # Resumes the execution of a saved VM
142 157
        def resume
143 158
            action('resume')
144 159
        end
145 160

  
161
        # Deletes a VM from the pool and DB
146 162
        def finalize
147 163
            action('finalize')
148 164
        end
149 165

  
166
        # Resubmits the VM after failure
150 167
        def restart
151 168
            action('restart')
152 169
        end
153 170

  
171
        # Saves a running VM and starts it again in the specified host
154 172
        def migrate(host_id)
155 173
            return Error.new('ID not defined') if !@pe_id
156 174

  
......
160 178
            return rc
161 179
        end
162 180

  
181
        # Migrates a running VM to another host without downtime
163 182
        def live_migrate(host_id)
164 183
            return Error.new('ID not defined') if !@pe_id
165 184

  
......
169 188
            return rc
170 189
        end
171 190
        
191
        # Set the specified vm's disk to be saved in a new image 
192
        # when the VirtualMachine shutdowns
193
        #
194
        # +disk_id+ ID of the disk to be saved
195
        #
196
        # +image_id+ ID of the new image where the disk will be saved
172 197
        def save_as(disk_id, image_id)
173 198
            return Error.new('ID not defined') if !@pe_id
174 199

  

Also available in: Unified diff