Jump to content
Welcome to our new Citrix community!
  • 0

SESSION INVALID


Mauritz Swanepoel

Question

Im busy implimenting a CBT backup and using the documentation as a guidance. I am now trying to export the VM metadata, but running into an error when trying to make the export_metadata call:

 

I am refering the following documentation:

https://github.com/xenserver/xs-cbt-samples/blob/master/cbt_vm_metadata_export.py#L15

https://developer-docs.citrix.com/projects/citrix-hypervisor-changed-block-tracking-guide/en/latest/getting-started/ (Point 2 optional)

 

My code is pretty simple:


 

# self.xensession == the session created when we authenticated
# uuid == the VM UUID

session_id = self.xensession._session
url = ("%s/export_metadata?session_id=%s&uuid=%s&export_snapshots=false"
 % (self.url, session_id, uuid))
request = self.xensession.get(url)
print(request)

I am returned a session is invalid error:

{'Status': 'Failure', 'ErrorDescription': ['SESSION_INVALID', 'https://10.1.3.5//export_metadata?session_id=OpaqueRef:3e26e693-ee41-424a-915b-6fac499604a2&uuid=6aded802-08d5-3bef-baab-6d6fec60bdfb&export_snapshots=false']}

I realised that above the session ID is "OpaqueRef:{ID}" so figured maybe it's a malformed error. But even if hardcode the sessionID like this:

 

# self.xensession == the session created when we authenticated
# uuid == the VM UUID

session_id = self.xensession._session
url = ("%s/export_metadata?session_id=%s&uuid=%s&export_snapshots=false"
 % (self.url, "3e26e693-ee41-424a-915b-6fac499604a2", uuid))
request = self.xensession.get(url)
print(request)

 

The error remains the same.

 

Earlier in my script I am able to interact with the XenAPI script by setting the NBD connections and those work fine. Are there any other methods for me to try and test or can anyone explain to me what I am doing wrong?
 

Link to comment

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...