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

implement cloning to multiple datastores (or upd documentation if that's possible now) #413

Open
bby-bishopclark opened this issue Jan 30, 2018 · 1 comment
Labels
Type: Enhancement Adds new functionality.

Comments

@bby-bishopclark
Copy link
Contributor

Versions:

2.0.1

Scenario:

I'm hoping to allocate clone a host with disks from multiple datastores, TO multiple datastores.

Template VM has 4 vHBAs. Disks on those vHBAs correspond to OS, Logs, Tmp/swap and Data, to evenly spread out writes to many queues.

While cloning this new layout, I realized that --datastore seems to only accept the one string . Docs and code didn't quickly suggest an array is possible (like --cvlan/cips) .

I'd like to clone with a

knife vsphere vm clone \
:
:
   --cvlan 'service-vlan,dbase-vlan' --cips '10.1.1.5,10.2.1.5' \
   --datastorecluster 'dsc-sas-os,dsc-sata-logs,dsc-ssd-tmpswp,dsc-sas-data' \
:
:

.. but I'm thinking rbvmomi doesn't give us the option. True? I tried to dive into that, but it quickly lost me.

Any chance?

I can clone, deploy and (later) migrate the fast, small VMDKs over to the SSD; that's no big deal. But it'd be so pretty to have it all in the one command, right?

No stress. I'm sure after that, someone would want to mix --ds and --dsc . Can of worms, this one ;-)

@bby-bishopclark bby-bishopclark changed the title implement cloning to multiple datastores (or fix documentation if that's possible now) implement cloning to multiple datastores (or upd documentation if that's possible now) Jan 30, 2018
@swalberg
Copy link
Collaborator

Just thinking out loud here.

https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.vm.RelocateSpec.html describes the RelocateSpec we use to clone the VM. We use the datastore option here. That seems to apply to any and all disks on that template.

It does look like there's a disk option that lets you specify an array of disks, though it needs both the datastore and a disk ID. Not sure where the second comes from, but that doesn't seem insurmountable to either look up or ask the user for.

Your comma idea is probably the ideal way to do it, and if we saw a comma in the string we'd split on that and fill in disk instead. It might be that we have to pass the id in too, such as --datastore dsc-sas-os:0,dsc-sata-logs:1,dsc-ssd-tmpswp:2,dsc-sas-data:3

That's datastores. Clusters seem a bit more complicated as we end up picking a data store from the cluster and not passing the cluster to VMWare itself (maybe it works? Who knows? Never tried. That code was from before my time here.)

So your ask doesn't sound that bad especially if we start with the simple case of datastores.

@tas50 tas50 added Type: Enhancement Adds new functionality. and removed Enhancement labels Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

No branches or pull requests

3 participants