<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _run_guest(userid, image_path, os_version, profile, cpu, memory, network_info, disks_list):
 """Deploy and provision a virtual machine. Input parameters: :userid: USERID of the guest, no more than 8. :image_name: path of the image file :os_version: os version of the image file :profile: profile of the userid :cpu: the number of vcpus :memory: memory :network_info: dict of network info.members: :ip_addr: ip address of vm :gateway: gateway of net :vswitch_name: switch name :cidr: CIDR :disks_list: list of disks to add.eg: disks_list = [{'size': '3g', 'is_boot_disk': True, 'disk_pool': 'ECKD:xcateckd'}] """

    # Import image if not exists
    import_image(image_path, os_version)

    # Start time
    spawn_start = time.time()
    # Create userid
    print("Creating userid %s ..." % userid)
    ret = sdk_client.send_request('guest_create', userid, cpu, memory,
                            disk_list=disks_list,
                            user_profile=profile)
    if ret['overallRC']:
        print 'guest_create error:%s' % ret
        return -1

    # Deploy image to root disk
    image_name = os.path.basename(image_path)
    print("Deploying %s to %s ..." % (image_name, userid))
    ret = sdk_client.send_request('guest_deploy', userid, image_name)
    if ret['overallRC']:
        print 'guest_deploy error:%s' % ret
        return -2

    # Create network device and configure network interface
    print("Configuring network interface for %s ..." % userid)
    ret = sdk_client.send_request('guest_create_network_interface', userid,
                            os_version, [network_info])
    if ret['overallRC']:
        print 'guest_create_network error:%s' % ret
        return -3
    # Couple to vswitch
    ret = sdk_client.send_request('guest_nic_couple_to_vswitch', userid,
                            '1000', network_info['vswitch_name'])
    if ret['overallRC']:
        print 'guest_nic_couple error:%s' % ret
        return -4
    # Grant user
    ret = sdk_client.send_request('vswitch_grant_user',
                            network_info['vswitch_name'],
                            userid)
    if ret['overallRC']:
        print 'vswitch_grant_user error:%s' % ret
        return -5

    # Power on the vm
    print("Starting guest %s" % userid)
    ret = sdk_client.send_request('guest_start', userid)
    if ret['overallRC']:
        print 'guest_start error:%s' % ret
        return -6

    # End time
    spawn_time = time.time() - spawn_start
    print "Instance-%s pawned succeeded in %s seconds" % (userid, spawn_time)