@@ -240,17 +240,21 @@ def cancel_instance(self, instance_id):
240240 """
241241 return self .guest .deleteObject (id = instance_id )
242242
243- def reload_instance (self , instance_id , post_uri = None , ssh_keys = None ):
244- """Perform an OS reload of an instance with its current configuration.
243+ def reload_instance (self , instance_id ,
244+ post_uri = None ,
245+ ssh_keys = None ,
246+ image_id = None ):
247+ """Perform an OS reload of an instance.
245248
246249 :param integer instance_id: the instance ID to reload
247250 :param string post_url: The URI of the post-install script to run
248251 after reload
249252 :param list ssh_keys: The SSH keys to add to the root user
253+ :param int image_id: The ID of the image to load onto the server
250254
251255 .. warning::
252- Post-provision script MUST be HTTPS for it to be executed.
253256 This will reformat the primary drive.
257+ Post-provision script MUST be HTTPS for it to be executed.
254258
255259 Example::
256260
@@ -268,8 +272,11 @@ def reload_instance(self, instance_id, post_uri=None, ssh_keys=None):
268272 if ssh_keys :
269273 config ['sshKeyIds' ] = [key_id for key_id in ssh_keys ]
270274
271- return self .guest .reloadOperatingSystem ('FORCE' , config ,
272- id = instance_id )
275+ if image_id :
276+ config ['imageTemplateId' ] = image_id
277+
278+ return self .client .call ('Virtual_Guest' , 'reloadOperatingSystem' ,
279+ 'FORCE' , config , id = instance_id )
273280
274281 def _generate_create_dict (
275282 self , cpus = None , memory = None , hourly = True ,
0 commit comments