def _set_image_id(self):
instance = self._get_instance()<EOL>image_info = instance.storage_profile.image_reference<EOL>if image_info.publisher:<EOL><INDENT>self.image_id = '<STR_LIT::>'.join([<EOL>image_info.publisher, image_info.offer,<EOL>image_info.sku, image_info.version<EOL>])<EOL><DEDENT>else:<EOL><INDENT>self.image_id = image_info.id.rsplit('<STR_LIT:/>', maxsplit=<NUM_LIT:1>)[<NUM_LIT:1>]<EOL><DEDENT>
If an existing instance is used get image id from deployment.