VMware Cloud Community
Kretschmer
Contributor
Contributor
Jump to solution

Move Datastore to a Folder

Hi there,

I am searching for a workflow which moves a datastore to a datastore folder. Couldn´t find it in the library, even google didn´t find any.

Appreciate any help

Christian

Reply
0 Kudos
1 Solution

Accepted Solutions
filosmith
Enthusiast
Enthusiast
Jump to solution

I don't know if there's a canned workflow, but you can create your own.

Create an array with the datastore(s) you want to move.

Get the object for the folder you want to move them to.

Then do folder.moveIntoFolder_Task(arrayOfDatastores);

View solution in original post

Reply
0 Kudos
2 Replies
Marmotte94
Enthusiast
Enthusiast
Jump to solution

Hi,

Can you use PowerCLI on your workflow ?

If you can use PowerCLI, you can use this Script :

$MydataFolder = get-folder -Type Datastore -Name Folder

$Datastore = Get-Datastore -Name datastoreName

Move-Datastore $Datastore -Destination $MydataFolder

Thank you.

Olivier.

Please, visit my blog http://www.purplescreen.eu/
Reply
0 Kudos
filosmith
Enthusiast
Enthusiast
Jump to solution

I don't know if there's a canned workflow, but you can create your own.

Create an array with the datastore(s) you want to move.

Get the object for the folder you want to move them to.

Then do folder.moveIntoFolder_Task(arrayOfDatastores);

Reply
0 Kudos