Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone a template example #8

Closed
snobear opened this issue Jan 30, 2014 · 18 comments
Closed

Clone a template example #8

snobear opened this issue Jan 30, 2014 · 18 comments

Comments

@snobear
Copy link

snobear commented Jan 30, 2014

Do you have any examples or docs on using the Clone() function, specifically how to clone/deploy a VM from a template?

@pdellaert
Copy link
Contributor

If you are interested, i'm working on a multi-clone script that can be used as an example, i'll try and finish it tomorrow and place a link here (and if VMware accepts it, they are allowed to add it to their samples set)

Basically, you need to do the following steps:

  • Create a RelocateSpec
  • Create a CloneSpec
  • Execute the Clone method on a VM

(very basic) Code example:

from pyVmomi import vim

def find_vm(si,name):
    content = si.content
    obj_view = content.viewManager.CreateContainerView(content.rootFolder,[vim.VirtualMachine],True)
    vm_list = obj_view.view

    for vm in vm_list:
        if vm.name == name:
            return vm
    return None

# Connecting to host
si = None
try:
    si = SmartConnect(host='server',user='username',pwd='password',port=443)
except IOError, e:
    pass

# Finding source VM
template_vm = find_vm(si,'template_name')

# Creating relocate spec and clone spec
relocateSpec = vim.vm.RelocateSpec()
cloneSpec = vim.vm.CloneSpec(powerOn=True,template=False,location=relocateSpec)

# Creating clone task
clone = template_vm.Clone(name='clonedVM01',folder=template_vm.parent,spec=cloneSpec)

@snobear
Copy link
Author

snobear commented Jan 31, 2014

@pdellaert thanks! I started working on a script yesterday and it is progressing nicely. Your example is showing I'm on the right track though, so it is helpful. I'll share mine once I'm finished with it.

@snobear
Copy link
Author

snobear commented Feb 3, 2014

@pdellaert Here is what I have so far: https://gist.github.com/snobear/8788977

I'm able to deploy a VM from the template, but I'm stuck on setting the network of the network adapter.

When I uncomment the line that sets the device, vsphere complains:

The operation is not supported on the object

No more details than that. I must be setting up the device incorrectly. My template has a NIC device already; I just need to change the network on it. Any idea how to do that, or am I close?

@pdellaert
Copy link
Contributor

Nice example! I have no experience with changing the hardware on a virtual machine, so i don't think i would be of much help. Altho i'm thinking of looking into it...

My example is a bit different:
https://github.com/pdellaert/vSphere-Python/blob/master/multi-clone.py

@snobear
Copy link
Author

snobear commented Feb 5, 2014

I updated the gist with my working example. It takes a few command-line arguments that you can see with --help. e.g.:

./clone.py --hostname test01 --ip 172.9.9.102

We use static IPs for everything and have several different networks, so what my example script does is take the static IP supplied by the user and determine where the new cloned VM should reside, what datastore, etc... So my networks and vSphere settings are hardcoded into the script. Well, I've changed them to fake networks for the purpose of this example but you get the idea. We don't have the most dynamic setup in our environment, so this works really well. Come to think of it, I bet hardcoding these things is unnecessary and I could probably add some better lookups.

I'm using python 2.7 and my pip requirements are:

netaddr==0.7.10
pyvmomi==5.5.0
wsgiref==0.1.2

Not sure if wsgiref was a carrover from me testing another vsphere py module (pysphere).

I believe this works with cloning any VM, and not just a template.

I'll close this issue since I'm satisfied :). I'm happy to submit a pull request to add this to the examples directory, but I'm not sure if it's generic enough. Let me know, VMware folks.

@snobear snobear closed this as completed Feb 5, 2014
@dadopap
Copy link

dadopap commented Mar 18, 2014

Thanks for this amazing script, I took the liberty of modifying some lines though,

Specifically I would suggest the check for the ethernet device to be done as:

   for device in template_vm.config.hardware.device:
            if isinstance(device, vim.vm.device.VirtualEthernetCard):

since some VMs (those at 32 bit for example) are configured with flexible devices and not with E1000 ones.

the vim.vm.device.VirtualEthernetCard is generic for a nic device

@snobear
Copy link
Author

snobear commented Jun 2, 2014

I moved this example to a more generic tool:

https://github.com/snobear/ezmomi

Feel free to fork and use what you want, or help me beef it up and add some features.

@jon67400
Copy link

Hello,

I have a problem when I use this method

device = template_vm.config.hardware.device

Do you have an idea to help me?

raceback (most recent call last):
File "vsphere.py", line 460, in
opt_parser(opt)
File "vsphere.py", line 423, in opt_parser
vm_parser(opt)
File "vsphere.py", line 238, in vm_parser
vm_create(opt)
File "vsphere.py", line 157, in vm_create
device = template_vm.config.hardware.device
File "/Library/Python/2.7/site-packages/pyVmomi/VmomiSupport.py", line 563, in call
return self.f(args, kwargs)
File "/Library/Python/2.7/site-packages/pyVmomi/VmomiSupport.py", line 386, in InvokeAccessor
return self.stub.InvokeAccessor(self, info)
File "/Library/Python/2.7/site-packages/pyVmomi/StubAdapterAccessorImpl.py", line 42, in InvokeAccessor
options=self.pcType.RetrieveOptions(maxObjects=1))
File "/Library/Python/2.7/site-packages/pyVmomi/VmomiSupport.py", line 569, in
self.f((self.args + (obj,) + args), *kwargs)
File "/Library/Python/2.7/site-packages/pyVmomi/VmomiSupport.py", line 378, in InvokeMethod
return self.stub.InvokeMethod(self, info, args)
File "/Library/Python/2.7/site-packages/pyVmomi/SoapAdapter.py", line 1292, in InvokeMethod
raise exc
pyVmomi.SoapAdapter.ParserError: 'xml document: \x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\xd5\x1b]s\xe3\xb8\xed\xfd~\x85&O\xed\x83\xad\x0f\xcb\x92\xedju\x93\xd8\xbb\xdd\xccn6\x998\xc9v\xda\xe9th\x89\xb6\xd9H\x94_RJ\xdc__P\xd4\xa7-'r.\xb9\x9b\xcedb\x11\x00\t\x10\x04\x01\x10\xa2\x9c\x9f\xc3@\xc9p\xc2HD?\x9d\xe9C\xedL\xc1\xd4\x8b|B7\x9f\xce\xee\xef\xbe\x0c&g\xbf\xba\xbf8,B1\xa6\xd9\xec3\xcdp\x10\xc5X\x81n\x94\xcd$\xd8\xfbt\xb6\xe5<\x9e\xa9
\xf3\xb68Dl\x08X\x81\x1aF\xc9F\x15\x0fj9\xa6z\xf6K\xabk\xd6\xa7\xabdYw}f~\xd5\xed\xe9\xe9i\xf84\xca\xa9\rM\xd3\xd5\xbf]}\xe6#5\xa8\xc9\xeb\xd4\x03B\x19G\xd4\xc3g\x8d\xc9^D\xfe\x0e\x9a\xb7\x98'\x04g\xf8&\x01)\x12N0\xfb\xfc|\x8bY\x1cQV\xe8\xe1\xd3Y\x9a\xd0YFBc|\xe6:\t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17Xx1bxc6xf2mUx0fx9ewxb7xf7xbdxe7xc1xb2rxfaxa0xa1+xd9xcdx8fgx90Uxeexbcx07x0fxe8x87o#xf1x968xe1oxe0xb5Nix1erYx0fVx93x93xc7x1fx7fxb4xb2xc6xbfxa3xb2xc6x1fxac,xebxa3x95exfdx8excaxb2>XYxf6G+xcbxfex1dx95ex7fx8cxb2xb61xe6xa7xb8Zx99axf5x1bxbbPxcexd7x9fCqx1b1xf5 xc3rcHx00V$xe8x17rxc5x1b,x91x1exf6xf4xecyxe8x15xd5Vmxa6rx8bZex9cxc2t%xeexc1+x12xd7izxce+xf4xc8pMxc4xa5xbfxa1|yxf3xcex8axc3xc5xd9nx16xa6x99x84xf7xe0"xdf\x9dx1ciOxe5bxbf%$x9exc8xc4xd0xdfx12JNerxbaxbaxacxd3x99x8cxdexe2xbaNebxf6ex92xe4x17xbfx86xc5k9xb1xbf^x1dxbcxbcIxd4sx1fxc2x0e<xddxa6xc4Kxa0Sx180xc4xfexbc\xf4x18zxac%29xdaXxfcx892xc3ZAx13x05xfbx8axd6x9f]xb4xae.xa2xbds$x11x9exe4tUx8dzx1bmx16F"bx0cxeb[m_.xc4xfbxec>x11d4x99XZxef8x92x85xe2T=x94'x92xfcx1d.EAq]xbcxd7fxafoxf7xbex81ax82xffx93x92x04xfbxfdx19NGxe3xdex1b&$x9bx04N4Cx11x8exbeGx9b%Gxbcx8fx06iD{xefx99x92x85xfcxcdxafxa9xf7xe0pxccx84xabW$xf7IP|x18Pxbfx9f%29xbfnHx01xa7fxe1x9axa9Yx14xa4!f*^x8dx91xafxafWx03Ox9bh62xc0xdax05Qxe3x95K>x1e{Bxf1Mx80<x1cx8axbbx84x84Bxac"xe2xb6dx0bxecxac xd1xb9x8exf3|E6x16x18xbcNxfex1axb6j8Xx18xcaxc5xe5xf5rx89yx1axd7x17"Zxd0xbcxb7xf8xe0cxffx1exebx01xbcxa6x94xe3x8bx1ax8bxd6xa0+xb8xaa-xd9xb2sxc6pxc2xd9xdexe0xfbxe0xe2x13x8exbbDx96x00xf7x8bx03x9dHgMx92xdcLxddx15x89x98xxddU4x9dx10=_=xb2yUhdxaexa9x89xdaxd6>Tx91 xaaxe6xe2Nxf2x1exd3NQx1ciTsxe4mxe6xbbxe8n=xb7xab$Ghx1cBt'%28xb8x86xddxb4xc5xc8xafx00Wxfbxbd\xddx98xe8x96=x1dYxe2kx8d#4exef%xd8Gx13nx98x869xd5G"a9BQ!jI%28x16x19xe1xd7x87=Mxecx83x9dxecxe6jxbexbfxa0rx90x93xe7x8a%29<~-xeax81xc5E|Yxe0L[xb7xf2%29xcex84[Nxf7xaexeax1fx19a)\x0b\xb2r\xf3\xbfBt\x9c@\xca\x91}\t\x10\xdb\xce\x11\x10\xdd\xb6\x0b|G0\xb9?\x10\xe5\xea\xf2\x9b%\xb5\xfa\xdaIm|\x02\xa5\xbe\xf4\xf9\x94\xfb\x8b\xa3\xee}m\xa5\xee\x7fj\xe6\xfe\x0f\x06\xf0\xa4$\xa46\x00\x00 parse error at: line:1, col:0'

Thanks.

Regards

@purple4reina
Copy link

@jon67400 Which object are you calling the method on? template_vm or device? Attach your full code and I'd be happy to take a look.

@dadopap
Copy link

dadopap commented Jan 16, 2015

Hi can you please be more specific (give some more code) as what you wrote
should never give any error since you are simply referencing variables and
not running any method. devices should be a list of devices that's it.

Thanks


Davide Papini
PostDoc Research Assistant - CySeCa Project
ISG - Royal Holloway University of London
s2lab.isg.rhul.ac.uk - cyseca.isg.rhul.ac.uk

[email protected]

On Fri, Jan 16, 2015 at 3:33 PM, jon67400 [email protected] wrote:

Hello,

I have a problem when I use this method

device = template_vm.config.hardware.device

Do you have an idea to help me?

raceback (most recent call last):
File "vsphere.py", line 460, in
opt_parser(opt)
File "vsphere.py", line 423, in opt_parser
vm_parser(opt)
File "vsphere.py", line 238, in vm_parser
vm_create(opt)
File "vsphere.py", line 157, in vm_create
device = template_vm.config.hardware.device
File "/Library/Python/2.7/site-packages/pyVmomi/VmomiSupport.py", line
563, in call
return self.f(args, *

_kwargs) File "/Library/Python/2.7/site-packages/pyVmomi/VmomiSupport.py",
line 386, in _InvokeAccessor return self._stub.InvokeAccessor(self, info)
File
"/Library/Python/2.7/site-packages/pyVmomi/StubAdapterAccessorImpl.py",
line 42, in InvokeAccessor
options=self._pcType.RetrieveOptions(maxObjects=1)) File
"/Library/Python/2.7/site-packages/pyVmomi/VmomiSupport.py", line 569, in
self.f((self.args + (obj,) + args), *_kwargs)
File "/Library/Python/2.7/site-packages/pyVmomi/VmomiSupport.py", line
378, in InvokeMethod
return self.

stub.InvokeMethod(self, info, args) File
"/Library/Python/2.7/site-packages/pyVmomi/SoapAdapter.py", line 1292, in
InvokeMethod raise exc pyVmomi.SoapAdapter.ParserError: 'xml document:
\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\xd5\x1b]s\xe3\xb8\xed\xfd~\x85&O\xed\x83\xad\x0f\xcb\x92\xedju\x93\xd8\xbb\xdd\xccn6\x998\xc9v\xda\xe9th\x89\xb6\xd9H\x94RJ\xdc__P\xd4\xa7-'r.\xb9\x9b\xcedb\x11\x00\t\x10\x04\x01\x10\xa2\x9c\x9f\xc3@\xc9p\xc2HD?\x9d\xe9C\xedL\xc1\xd4\x8b|B7\x9f\xce\xee\xef\xbe\x0c&g\xbf\xba\xbf8,B1\xa6\xd9\xec3\xcdp\x10\xc5X\x81n\x94\xcd$\xd8\xfbt\xb6\xe5<\x9e\xa9\xf3\xb68Dl\x08X\x81\x1aF\xc9F\x15\x0fj9\xa6z\xf6K\xabk\xd6\xa7\xabdYw}f~\xd5\xed\xe9\xe9i\xf84\xca\xa9\rM\xd3\xd5\xbf]}\xe6#5\xa8\xc9\xeb\xd4\x03B\x19G\xd4\xc3g\x8d\xc9^D\xfe\x0e\x9a\xb7\x98'\x04g\xf8&\x01)\x12N0\xfb\xfc|\x8bY\x1cQV\xe8\xe1\xd3Y\x9a\xd0YFBc|\xe6:\t\xe6\xd0\xccP\xe0:\xd1\xea\xdf\xd8\xe3,\x7fP\xf8.\xc6\x9f\xce\x1eH\xc2S\x14!oK(\xb0\xcb\xc2\x81aL\x1c\x15('\x06\x16K\xcc]\x87\xa2\x10\xbb^D\xd7d\xe3\xa8y\xc3\x81\x01\x15\x98\xcb\xack\x98yNyI\xd7\x11\xf0\xf7\xb6\x88n\xf0\x83\S\xd7\xd0\xf4\xf1@\xd3\x07\xda\xf4N\xd7f\xe
3\xc9ll\x0f\x8d\xb152\xc7\x7fw\xd46\xa9\x13\xc2\x1a\xad\t\xf6]}jky'\xfdN\xd3f\xf9\x1fPWh)\x1e\xc7a\x1c
\x8e\x07 \xb5_J\xb9I1\xe3\xd2
\xf8!\x9a\x0b\xbc"\x88\x7f\xfdq\xaf~'4}Vl\xe5O\x969X\x11\xfegGm\x93:\x85\x11\x82B\x9e\x07\xba\xe6\xa8e\xdbIS\xe2\xbb\xa6\xa1\xfb\xc82G\x03\xcdX\xeb\x03\xcf\xd3F\x83\x11\x9e\x8c\x07\xfa\xd80\xc7\xd8\x1cas\x05J\xccI\x9dr-\xefEk\xac\xe9\xbe?B\xd3\x81o\x1b\xe6\xb2FhkSk\xae\xd6\x96\xb1\xd2\xa6So:v\xd4V\x17\x87\xc6$\xbb\x83\xd9E\tJv\x0b\xc2\xd0\x80Y\xf3$\xc50\xcdN\x9c\x13D\x1e\xe2
\xee%<\xab\xcdF\xa9\xa5\xa2{\xd5\x94\x9a\x02\n?\xd7\x91\xfd/\xcb\xfc\xab\x80\x14z\x11]Q\xc0qB\x818GH-\xa9]@di
https://github.com/Di\xc4s\x8e\x82\xa0\xd1X\x93\x00\x83\xf5e\xe1\r\xe2\xdb\x9c\xf6\x1f\xb1\xe7\r4md\x18\xda?\x95j\x05\xa5\x0c\x03[=\x80\x0c\xb3\x90?\xc3b\xd4#8\x8c\xa2\x98m#\xbe
\t\x18w\x94\xec^\x1b\xd4Q\x0f\xbb8,e\xb0\xc9\xfcS\x06\xd9\xef\x01J\xdf\x9c\xd0\xbfE\xed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a1\x1a\xc1\xfd\t%0\x08M\xc3\xf9\xcd\xbd\xabC,\x92O9\x04\xfc\x01\xbb\xc1\xc9R\x98\x13/\x91m\xa0\x13\xe2\x10|\xdf\xd5\x05$\x05&D\xcb\xaaY\x1a\xca\xe5\xfc\xab}u#\x94F+w\xd0\x85_\xe9\x97W\xf3n\xea\x06\x02\x94\x93\x11\x0f\x1f\xa6.\x97\x8b\xcf\x90\xb6\xf0$\n\xcfC\xda\xf2\x88w
\x17\xb8\x14\xf1P\xf4\x92\xdb4@+\x1c\xb8@\xafh\xc2\xcd\x88\x06\x18B\x18B\x00.\xa1eS(\xae\xee\xb8J\xd9\x8f4\IOU7J\xa2Se\xd3_\x94M\xef\x94M\x7f]6\xbd%[!\xdaH\xd3\x8cZ\xceW\x05\xbeY\x1a\x07\x02\x8f^P&\xd0+^\xd5\xa1C\xaf\x87\x04\xa7\xa9\xb8\x10\xd8\x122\xb4\x85w\xed&\xec\xf5\x99\xcd/\x0ff\xa6\xbf4\xb3\xf9\xe5+3;
x\xd3\xcc\xc6\x1d3\xd3\xc1~;\xa0]@s https://github.com/S;I\x0b\xcb\xcb\xeb\x03-\x98/h\x01\xe8_\xd6\xc2!\xc1\x9b\xb409m\x1a\xdf\xf0n\x15\x81#+f\xbd0\x83\x92T9\x10\xbd\xc4\x1c\x13\xb9\x9e\xd6\xb7r\x17\xb4AN\n\x11\xbe\x9eU\xa3\xd5\xc3\x1c\x85\xbb\x86\x04\x91\xe3\x8by\xd8/\xd9c\xd1A\x91\xa8Csl\xe3\xff
\xa2,\n\xba#\xeb\x81\xbcGA\xfd\x8a\xf2\xff\x85$.\xce\x85r\x98\xe2\x18\xd1l@
\xe2$\xd2\x82\x05\xe6\x90\x1c7\xb2\xa9\x06\xd0\xd9B&\xd8f\x91g\x1e~\x8e\x86\xc4\xe8\x10\r\xe6"\xd9\x9f\xb8"\xfa\x89+R\x1c\x81\x1f\x88\x8f\xa3ym\xe3\x17\xd6$\xa7U\xbc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\xbd>\x84\xcf\x14\xf3Q]
@8 https://github.com/8\xbe\xc8?0\x7f\x8a\x92G\x05\xf9(\x86,\xb9c\x9d\x17\x0f\xcb\'\xc2\xbd\xedL\x19\x9b\x8a\x06\x96\xe0+cM\xb1\x90\xe2y\x8ai\x03d0\x1a\xc1AJ\xd1\xe1OS\xec\xb1\xb2\xf2\x95\xc9T\xf1W\'\x9b\xc6gH\xe5\x13\x10\x1c\xef
@\x80\xfeV)\xa8\xb4:\xf9&\xbcm*\xf2h\xc3r\xe9\xe4K\xc0\x93\x05\xac\xfb\xe6\xa3m\xc0\t\xc7B\xfb
V5\x07\xb6.\xca\xd3\rdN\x9a\x87\xe5\xf1T\xa2rh\xb1\xbe\xb0U\xe7Q\xf4H\xb0\xab\x8f,c26M\xabZ\xfb\x1a'\xfb\xf5\xb5Xi\x88
x7f\xa8\xc1\xfe\xd6\x84|\xfa~\x87\xa4\xbd3\x12\xf2}p\x9e,/\xbdCFI6T\xcc\xa2\tu\xe0\x.\xdb\xae\xa6\xcd\xc6\xf0g\xcd\xa6\xfeL\x1b\xcd,
m\x9d'\xf4\x88\xaf\xe9wD\xcb\xe8&Uz\x00nT\xc3\xea\x92\xbd\x17\xa7M\x7f\xfd\x92\x87\xc7\xcf1\xa2\xbe\x18\xeb\xb6\x01\xae2\xd6.\xe4\xbbF\x1fuOV\xf9\x92\xe0\x8f\x94^\xbc\xac\xe8/\xfe\xa1\xbc"\x19\xa4\xden\x89)#\x9cd\x90\x06\x1c\x1b\xa4\x8bR\x8e\xf75?\x9b\xede;\x0b\xb2r\xf3\xbfBt\x9c@\xca\x91}\t\x10\xdb\xce\x11\x10\xdd\xb6\x0b|G0\xb9?\x10\xe5\xea\xf2\x9b%\xb5\xfa\xdaIm|\x02\xa5\xbe\xf4\xf9\x94\xfb\x8b\xa3\xee}m\xa5\xee\x7fj\xe6\xfe\x0f\x06\xf0\xa4$\xa46\x00\x00
parse error at: line:1, col:0'

Thanks.

Regards


Reply to this email directly or view it on GitHub
#8 (comment).

@jon67400
Copy link

Here is the content of the template_vm:

template_vm = get_obj(content, [vim.VirtualMachine], template)

where template is the name of the vm template.

Here is the content of the get_obj method

def get_obj(content, vimtype, name):
obj = None
container = content.viewManager.CreateContainerView(content.rootFolder, vimtype, True)
for c in container.view:
if c.name == name:
obj = c
break
return obj

What I don't understand, why the xml parsed is in binary code not understood by human?

@purple4reina
Copy link

Try using some print statements to see what's going on. For example:

print template_vm
print template_vm.config
print template_vm.config.hardware
print template_vm.config.hardware.device

This will allow you to know exactly where the error is occurring.

@jon67400
Copy link

with prints...

'vim.VirtualMachine:vm-228'
Traceback (most recent call last):
File "vsphere.py", line 465, in
opt_parser(opt)
File "vsphere.py", line 428, in opt_parser
vm_parser(opt)
File "vsphere.py", line 243, in vm_parser
vm_create(opt)
File "vsphere.py", line 158, in vm_create
print template_vm.config
File "build/bdist.macosx-10.6-intel/egg/pyVmomi/VmomiSupport.py", line 560, in call
File "build/bdist.macosx-10.6-intel/egg/pyVmomi/VmomiSupport.py", line 383, in InvokeAccessor
File "build/bdist.macosx-10.6-intel/egg/pyVmomi/StubAdapterAccessorImpl.py", line 42, in InvokeAccessor
File "build/bdist.macosx-10.6-intel/egg/pyVmomi/VmomiSupport.py", line 566, in
File "build/bdist.macosx-10.6-intel/egg/pyVmomi/VmomiSupport.py", line 375, in InvokeMethod
File "build/bdist.macosx-10.6-intel/egg/pyVmomi/SoapAdapter.py", line 1291, in InvokeMethod
pyVmomi.SoapAdapter.ParserError: 'xml document: \x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\xd5\x1b]s\xe3\xb8\xed\xfd~\x85&O\xed\x83\xad\x0f\xcb\x92\xedju\x93\xd8\xbb\xdd\xccn6\x998\xc9v\xda\xe9th\x89\xb6\xd9H\x94*RJ\xdc__P\xd4\xa7-'r.\xb9\x9b\xcedb\x11\x00\t\x10\x04\x01\x10\xa2\x9c
\x9f\xc3@\xc9p\xc2HD?\x9d\xe9C\xedL\xc1\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x00W\xfb\xbd\xdd\x98\xe8\x96=\x1dY\xe2k\x8d#4e\xef%\xd8G\x13n\x98\x869\xd5G"a9BQ!jI(\x16\x19\xe1\xd7\x87=M\xec\x83\x9d\xec\xe6j\xbe\xbf\xa0\r\x90\x93\xe7\x8a)<~-\xea\x81\xc5E|Y\xe0L[\xb7\xf2)\xce\x84[N\xf7\xae\xea\x1f\x19a)\x0b\xb2r\xf3\xbfBt\x9c@\xca\x91}\t\x10\xdb\xce\x11\x10\xdd\xb6\x0b|G0\xb9?\x10\xe5\xea\xf2\x9b%\xb5\xfa\xdaIm|\x02\xa5\xbe\xf4\xf9\x94\xfb\x8b\xa3\xee}m\xa5\xee\x7fj\xe6\xfe\x0f\x06\xf0\xa4$\xa46\x00\x00 parse error at: line:1, col:0'

@purple4reina
Copy link

@jon67400 I'm sorry but it seems you've reached the limit of my knowledge. I've tried googling around for your error, but haven't found anything.

@dadopap
Copy link

dadopap commented Jan 17, 2015

Hi,

Probably this is a stupid question to ask, but do you have problems with
other functions or everything works perfectly?

Does the version of the VMware sdk support the vsphere environment version
that you have?


Davide Papini
PostDoc Research Assistant - CySeCa Project
ISG - Royal Holloway University of London
s2lab.isg.rhul.ac.uk - cyseca.isg.rhul.ac.uk

[email protected]

On Fri, Jan 16, 2015 at 8:44 PM, Reina Abolofia [email protected]
wrote:

@jon67400 https://github.com/jon67400 I'm sorry but it seems you've
reached the limit of my knowledge. I've tried googling around for your
error, but haven't found anything.


Reply to this email directly or view it on GitHub
#8 (comment).

@michaelrice
Copy link
Contributor

This should have been opened as a new issue.

@hartsock
Copy link
Member

I'm having trouble parsing this thread. It would help if we could get a failing sample in a gist to work with.

@shbalu07
Copy link

Hi All,

I am seeing the below issue when trying to do vm migration from one node to another one.
Always it is throwing the below error, any body have a clue?

    vm_relocate_spec = vim.vm.RelocateSpec()
    vm_relocate_spec.host = destination_host
    vm_relocate_spec.pool = resource_pool
    datastores = destination_host.datastore
    print datastores
    #Assuming Migrating between local datastores
    for datastore in datastores:
        print datastore.summary.type
        if datastore.summary.type == 'VMFS':
            vm_relocate_spec.datastore = datastore
            #dump(datastore)
            break
    dump(vm_relocate_spec)
    task = vm.Relocate(spec=vm_relocate_spec)

    # Wait for Migrate to complete
    wait_for_task(task, si)

except vmodl.MethodFault, e:
    print "Caught vmodl fault: %s" % e
    return 1

<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>
Caught vmodl fault: (vmodl.fault.InvalidArgument) {
dynamicType = ,
dynamicProperty = (vmodl.DynamicProperty) [],
msg = 'A specified parameter was not correct. \n',
faultCause = ,
faultMessage = (vmodl.LocalizableMessage) [],
invalidProperty =
}
<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>

<<<<<<<<<>>>>>>>
obj.str = <bound method vim.vm.RelocateSpec.FormatObject of (vim.vm.RelocateSpec) {
dynamicType = ,
dynamicProperty = (vmodl.DynamicProperty) [],
datastore = 'vim.Datastore:datastore-37',
diskMoveType = ,
pool = 'vim.ResourcePool:resgroup-30',
host = 'vim.HostSystem:host-36',
disk = (vim.vm.RelocateSpec.DiskLocator) [],
transform = ,
deviceChange = (vim.vm.device.VirtualDeviceSpec) [],
profile = (vim.vm.ProfileSpec) []
}>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants