Comments (8)
@kartikaydw Just to make sure I'm understanding the issue correctly, the vmdk_spec refuses to allow you to pass a path which means that it always uses the default path and you need to use a non-default path. Is this correct?
from rbvmomi.
@jrgarcia Yes you are right, basically I want to create a disk under specified VM folder and then attach the virtual disk to the VM.
from rbvmomi.
@kartikaydw Looking at your code snippet, you are creating a VslmCreateSpecDiskFileBackingSpec
, but the VslmCreateSpec
takes a VslmCreateSpecBackingSpec
and that takes an optional path
parameter. I can see that the vmodl.db
has this correctly.
...
"VslmCreateSpecBackingSpec"=>
{"kind"=>"data",
"props"=>
[{"name"=>"datastore", "is-optional"=>false, "is-array"=>false, "version-id-ref"=>nil, "wsdl_type"=>"Datastore"},
{"name"=>"path", "is-optional"=>true, "is-array"=>false, "version-id-ref"=>"vim.version.version12", "wsdl_type"=>"xsd:string"}],
"wsdl_base"=>"DynamicData"},
...
If you use this type (VslmCreateSpecBackingSpec
), does it work?
from rbvmomi.
Thanks @jrgarcia for looking into this.
Yes I tried using VslmCreateSpecBackingSpec in the below snippet , but it fails out with error
vmdk_spec = RbVmomi::VIM::VslmCreateSpecBackingSpec(
datastore: vmdk_datastore,
#provisioningType: 'thin',
path: "[#{vmdk_datastore.name}] #{vmdk_file_name}"
)
vmdk_backing = RbVmomi::VIM::VslmCreateSpec(
capacityInMB: size.to_i * 1024,
backingSpec: vmdk_spec,
name: "[#{vmdk_datastore.name}] #{vmdk_file_name}",
)
vdisk = vim.serviceContent.vStorageObjectManager.CreateDisk_Task(
spec: vmdk_backing,
).wait_for_completion
Traceback (most recent call last):
1: from vCenter/add_disk.rb:172:in <main>' /usr/local/lib/ruby/gems/2.6.0/gems/rbvmomi-2.0.0/lib/rbvmomi/vim/Task.rb:14:in
wait_for_completion': InvalidArgument: A specified parameter was not correct: spec.backingSpec (RbVmomi::Fault)
from rbvmomi.
Ok, just wanted to make sure. I'll continue to check into this. Thanks!
from rbvmomi.
I'm still looking into this. I'm waiting on feedback to confirm a suspicion I have. I'll let you know as soon as I have any info.
from rbvmomi.
Thanks @jrgarcia
from rbvmomi.
Ok, it appears that the path
is expected to be a certain format. It should be an existing folder and nothing more meaning that you don't include [#{datastore.name}]
or give a file name. It is just the name of an existing folder on that datastore. For example, instead of '[datastore1] folder1/folder2/filename.vmdk'
you would just do 'folder1/folder2'
.
from rbvmomi.
Related Issues (20)
- createDate under vm config property shows empty in rbvmomi HOT 12
- Memory leak caused by at_exit {} usage HOT 4
- esxcli option not working HOT 1
- RbVmomi 2.1.0 breaks PBM HOT 6
- Drop support for all EOL Ruby versions
- Add code coverage/review tools to run for every commit/PR
- Get code coverage to a respectable level
- Revamp the VMODL DB usage HOT 1
- API to create Datastore HOT 18
- A specified parameter was not correct: HOT 11
- Trying to get an example to add an nvdimm device/host PMEM datastore to a virtual machine. I've read the docs, but I'm missing some clarity somewhere, and keep getting errors. HOT 3
- kitchen destroy stopped working on kitchen-vcenter HOT 7
- portgroup info empty HOT 5
- Error message while using esxi_cpu_stats.rb HOT 10
- Definition of StoragePod class and how to query for it? HOT 1
- Add linting/code analysis HOT 4
- Update Hash syntax HOT 6
- RbVmomi deserialization fails on managed object type `ContentLibrary` HOT 4
- New Data Types added in vSphere 7.0 U1 and U2 missing from vmodl.db
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rbvmomi.