def deploy_guest(userid, image_name):
    """ Deploy image to root disk.

    Input parameters:
    :userid:            USERID of the guest, last 8 if length > 8
    :image_path:        Image file name
    """
    print("\nDeploying %s to %s ..." % (image_name, userid))
    guest_deploy_info = client.send_request('guest_deploy', userid, image_name)
    
    # if failed to deploy, then delete the guest.
    if guest_deploy_info['overallRC']:
        print("\nFailed to deploy guest %s!\n%s" % (userid, guest_deploy_info))
        print("\nDeleting the guest %s that failed to deploy..." % userid)

        # call terminage_guest() to delete the guest that failed to deploy.
        delete_guest(userid)
        os._exit(0)
    else:
        print("Succeeded to deploy %s!" % userid)
Deploy image to root disk.

    Input parameters:
    :userid:            USERID of the guest, last 8 if length > 8
    :image_path:        Image file name