docs: def image_import(self, image_name, url, image_meta, remote_host=None):
          """Import the image specified in url to SDK image repository, and
          create a record in image db, the imported images are located in
          image_repository/prov_method/os_version/image_name/, for example,
          /opt/sdk/images/netboot/rhel7.2/90685d2b-167bimage/0100"""
          image_info = []
          try:
              image_info = self._ImageDbOperator.image_query_record(image_name)
          except exception.SDKObjectNotExistError:
              msg = ("The image record %s doens't exist in SDK image datebase,"
                     " will import the image and create record now" % image_name)
              LOG.info(msg)
  
          # Ensure the specified image is not exist in image DB
          if image_info:
              msg = ("The image name %s has already exist in SDK image "
                     "database, please check if they are same image or consider"
                     " to use a different image name for import" % image_name)
              LOG.error(msg)
              raise exception.SDKImageOperationError(rs=13, img=image_name)
  
          try:
              image_os_version = image_meta['os_version'].lower()
              target_folder = self._pathutils.create_import_image_repository(
                  image_os_version, const.IMAGE_TYPE['DEPLOY'],
                  image_name)
          except Exception as err:
              msg = ('Failed to create repository to store image %(img)s with '
                     'error: %(err)s, please make sure there are enough space '
                     'on zvmsdk server and proper permission to create the '
                     'repository' % {'img': image_name,
                                     'err': six.text_type(err)})
              LOG.error(msg)
              raise exception.SDKImageOperationError(rs=14, msg=msg)
  
          try:
              import_image_fn = urlparse.urlparse(url).path.split('/')[-1]
              import_image_fpath = '/'.join([target_folder, import_image_fn])
              self._scheme2backend(urlparse.urlparse(url).scheme).image_import(
                                                      image_name, url,
                                                      import_image_fpath,
                                                      remote_host=remote_host)
  
              # Check md5 after import to ensure import a correct image
              # TODO change to use query image name in DB
              expect_md5sum = image_meta.get('md5sum')
              real_md5sum = self._get_md5sum(import_image_fpath)
              if expect_md5sum and expect_md5sum != real_md5sum:
                  msg = ("The md5sum after import is not same as source image,"
                         " the image has been broken")
                  LOG.error(msg)
                  raise exception.SDKImageOperationError(rs=4)
  
              # After import to image repository, figure out the image type is
              # single disk image or multiple-disk image,if multiple disks image,
              # extract it,  if it's single image, rename its name to be same as
              # specific vdev
              # TODO: (nafei) use sub-function to check the image type
              image_type = 'rootonly'
              if image_type == 'rootonly':
                  final_image_fpath = '/'.join([target_folder,
                                                CONF.zvm.user_root_vdev])
                  os.rename(import_image_fpath, final_image_fpath)
              elif image_type == 'alldisks':
                  # For multiple disks image, extract it, after extract, the
                  # content under image folder is like: 0100, 0101, 0102
                  # and remove the image file 0100-0101-0102.tgz
                  pass
  
              # TODO: put multiple disk image into consideration, update the
              # disk_size_units and image_size db field
              disk_size_units = self._get_disk_size_units(final_image_fpath)
              image_size = self._get_image_size(final_image_fpath)
              # TODO: update the real_md5sum field to include each disk image
              self._ImageDbOperator.image_add_record(image_name,
                                                     image_os_version,
                                                     real_md5sum,
                                                     disk_size_units,
                                                     image_size,
                                                     image_type)
              LOG.info("Image %s is import successfully" % image_name)
          except Exception:
              # Cleanup the image from image repository
              self._pathutils.clean_temp_folder(target_folder)
              raise