pysphere vm.clone() from VM Template = "Unable to access the virtual machine configuration: xxxxxx.vmtx"

845 views
Skip to first unread message

David Dyball

unread,
Jan 28, 2013, 11:28:07 AM1/28/13
to pysp...@googlegroups.com
Hi All,

I'm getting an odd issue when I try to clone a VM from an existing VM Template file:

# Find my Template 
template = server.get_vm_by_name("my_template")
# Select my only resource pool
respool = server.get_resource_poolss().keys()[[0]
# Clone the VM 
          new_server = template.clone("new-server",resourcepool= 
 
"VIException: [Task Error]: Unable to access the virtual machine configuration: Unable to access file [DATASTORE-1] my_template/my_template.vmtx"

 From reading the .clone() docstring I can see that it will default to the same folder as the source if I don't specify a "folder", but surely it would not be trying to create the new clone under "[DATASTORE-1] my_template/*" right?

I can't see any methods for creating destination folders in the docs, so I was wondering if anyone has any snippets for performing this operation without nice wrapper-functions?

Cheers,
David.

Seba

unread,
Mar 12, 2013, 9:52:45 AM3/12/13
to pysp...@googlegroups.com

Hi David,

    The folder parameter represents a logical arrangement in your ESX/vCenter server, not the directory paths in a datastore. It seems to be a permission issue, it can't reach the template configuration file to get the clone from.

Have you been able to clone from that template using the VMWare vSphere Client tool and the same user/password?

If you still want to create folders (remember they are not directories in a datastore) you might want to check this thread: https://groups.google.com/forum/?fromgroups=#!searchin/pysphere/create$20folder/pysphere/MfFnDBylBMI/-1ST_NARo1EJ

Let me know about any progress or issues you get on this.


Regards,

Seba.

David Dyball

unread,
Mar 12, 2013, 9:55:27 AM3/12/13
to pysp...@googlegroups.com
Hi Seba,

I did eventually get this working. Not sure what happened though as the credentials/privs never changed, but now suddenly it works a few months later. I now have VM clone+configure automated thanks to PySphere! Saved myself a ton of work with only 30 lines of code :-P

Thanks,
David.


--
Has recibido este mensaje porque estás suscrito a un tema del grupo "pysphere" de Grupos de Google.
Para anular la suscripción a este tema, visita https://groups.google.com/d/topic/pysphere/xIEJu5Ty6eE/unsubscribe?hl=es. Para anular la suscripción a este grupo y todos sus temas, envía un correo electrónico a pysphere+u...@googlegroups.com.

Para obtener más opciones, visita https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages