VMware Cloud Community
dekoshal
Hot Shot
Hot Shot

Need help with script for restoring VM folder structure and roles&permission

Need help with the script for below mentioned requirement. 

scenario

==========

VC1 =  Existing 6.0 vcenter  server 

VC2 = Newly deployed 6.5 VCSA.

We have already imported dv switch configuration from VC1 to VC2 . our plan is to move one cluster at a time from VC1 to VC2. Once we create the new cluster in VC2 we will add the hosts from corresponding cluster of VC1.  Following that  we need script that will restore :

1.   Export and import script for folder structure at the cluster level  from  VC1 to VC2

2.   Export and import script for Moving the VM’s to their respective folders. 

3.    Export and import script for Roles and permission at the cluster level from V1 to VC2

Thank you for the help.

Reply
0 Kudos
5 Replies
LucD
Leadership
Leadership

There are several scripts out there, that do exactly what you want to do.

Have, for example, a look at Garbie's Cheap disaster recovery


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dekoshal
Hot Shot
Hot Shot

I have already tried that i am getting error on

Add-PSSnapin VMware.VimAutomation.Core.

As we are not moving all the cluster and esxi at once to VC2, i was wondering how to make sure that folder structure, vm mapping to folders and roles&permission can be mirrored on VC2 at cluster level because we will be moving one cluster at a time. this is unlike the cheap disaster recover scripts where the target VC is mirrored with source VC at once. 

Reply
0 Kudos
LucD
Leadership
Leadership

If you are using PowerCLI 6.5.1 or higher, there are no more PSSnapin.

You can remove that line.

You can edit the export file, and only keep what you want to import.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
dekoshal
Hot Shot
Hot Shot

getting error exporting roles&permission.

error.JPG

Reply
0 Kudos
dekoshal
Hot Shot
Hot Shot

I was able to used your v2 script to fix this error. Thanks

Reply
0 Kudos