Data Center migration of virtual machines and records from one data center to another.

So, I found an online script that migrates your inventory during one vCenter to another.  I broke the script into two pieces that export (path of the folder path of the VM folder, permissions of folder and notes and custom attributes) and the other to import (create folders, move the virtual machines in the original folder, reset the permissions and set notes and custom attributes).

The export script works very well.  I have problems with the import script.  If I have the name of the duplicate folder in the tree view of the structure of the tree will get duplicated under each similar folder.  i.e.

Exported folder structure

Portuagal-> football

Spain> football> football

Any folder structure

Portugal> football> football

Spain> football> football

I guess I should somehow figure out the ID of file but don't have a clue where to start.

I rewrote the section import of files of the script to avoid the problem of duplicated folder. The new script detects the parent folder by starting to look at the record of the root instead of just the folder above where it should be created. Because the full path is in the .csv file it is possible. The following script should now work correctly:

##IMPORT FOLDERS
$vmfolder = Import-Csv "c:\Folders-with-FolderPath-$($datacenter).csv" | Sort-Object -Property Path 

foreach($folder in $VMfolder){
     $Path = $folder.Path.split("\")
     $PathLength = $Path.Length
     $SubFolder = Get-Datacenter $datacenter | Get-Folder vm
     For ($i= 1; $i -lt $PathLength-1; $i++) {
        $SubFolder = Get-Folder -Location $Subfolder -Name $Path[$i]
     }
     New-Folder -Name $folder.Name -Location $SubFolder
}

Because the forum software has problem with hooks and contains the script, I have attached the vCenter_migration_import.ps1 script has changed.

Best regards, Robert

Tags: VMware

Similar Questions

  • Dual boot, how to transfer programs and files from one XP installation to another?

    Due type virus problems and the inability to get things working properly after I finally removed them, I tried to repair windows xp by using the disc that came with the computer (Systemax). Apparently, I managed to rInstaller windows xp pro with the new version under windows.0 and the old version under windows. The new windows.0 boots and is beautifully, and I can find with my old programs and data files. Unfortunately, none of the old programs seem to be accessible. I can reinstall most of them, but what a chore. I can not even the old windows at startup (it literally takes over half an hour) and many programs take a long time to come, if they. Virtually unusable.

    What can I do to have access to the previous programs using the new installation of windows xp pro, so I can simply remove the old windows entirely or at least not do it as an option whenever I start.

    Thank you

    (better known under the name of Brian) buzzstar

    * original title - two Windows xp pro on drive, no partition, but one that doesn't work not correctly must the programs, and the 'good' version besoin.*

    Hello

    It seems that you have made a parallel installation on the system (installed a new operating system on the same partition), we recommend only if a person has to back up files/data that is present on the system.

    You cannot transfer programs in this way and we do not recommend you to have two operating systems on the same partition. I suggest you to save files which and records that are important and then do a format clean installation of Windows XP on the system.

    Unfortunately, you need to install the programs on the system in order to to use.

    I suggest you to check the article mentioned below.

    How to install or upgrade to Windows XP

    http://support.Microsoft.com/kb/978307

    Thanks and regards.

    Thahaseena M
    Microsoft Answers Support Engineer.
    Visit ourMicrosoft answers feedback Forum and let us know what you think.

  • Get the IP of the virtual machine and MAC

    Hello

    I'm trying to get the IP of the virtual machine and the MAC one of my data centers.

    When I run that the following script two things happen:

    1. I don't see a vm in the output of the csv file.

    2. when I send the output to the quick PowrCLI I see only a mac and one IP address for virtual machines with network cards.

    Script

    ---------

    $MV = Get-Data Center $DC | Get-vmhost | Get - VM

    {foreach ($VM to $VMs)

    $VMx = get-view $VM.ID

    $HW = $VMx.guest.net

    foreach ($dev to $HW)

    {

    foreach ($ip in $dev.ipaddress)

    {

    $dev | Select

    @{Name = 'Name'; {Expression = {$vm.name}}.

    @{Name = 'IP address'; Expression is {$ip}},

    @{Name = 'MAC'; {Expression = {$dev.macaddress}} |

    Export-CSV VM - IP - Info.csv - NoTypeInfo

    }

    }

    }

    My console output, tested on a virtual machine with two external network cards and an internal interface "dummy".

    Name                               IP                                  MAC

    ----                                   --                                    ---

    VM1 192.168.1.1 00:50:56:xx:xx:xx

    VM1 192.168.2.1 00:50:56:xx:xx:xx

    VM1 192.x.x.xxx xx

    You see the addresses expected in summary using vSphere Client VM?

    Oh sorry, I forgot the PS 3.0 requirement.

    You can put all the entries in a table and export all at the end of the script.

    $out = @)
    $VMs = get-data center $DC | Get-vmhost | Get - VM
    {foreach ($VM to $VMs)
    $VMx = get-view $VM.ID
    $HW = $VMx.guest.net
    foreach ($dev to $HW)
    {
    foreach ($ip in $dev.ipaddress)
    {
    $out += $dev. Select @{Name = 'Name'; {Expression = {$vm.name}}, @{Name = 'IP address'; Expression = {$ip}}, @{Name = 'MAC'; {Expression = {$dev.macaddress}}
    }
    }
    }

    $out | Export-Csv - NoTypeInformation-Path ' VM - IP - Info.csv.

    Concerning

    Emanuel

  • Suggestion on Vcenter DB migration on the new virtual machine and enhancement vcenter server

    Hello

    I'm looking for any suggestion/plan with Vcenter DB migration steps towards the new virtual machine, and then upgrade the server vcenter

    4.1 for Update1/2

    My plan will be

    (1) creating new virtual machine.

    (2) fresh install 64-bit OS

    (3) migration Vcenter DB of the physical server to the new virtual machine.

    (4) upgrade to Vcenter Server 4.1 update 41 4.1 Update1/2

    Anything else missing then please let me know.

    Thank you

    vmguy

    Hi vmguy

    I agree with this approach

    (3) migration Vcenter DB of the physical server to the new virtual machine.

    As long as you leave the old DB in tact and simply detach and copy the DB to the new Victoria Cross.

    Before you run the upgrade on the new VC and DB.

    This way, you have a restoration plan in case something goes wrong with the upgrade.

    Just to add:

    You must migrate the ADAM database so to maintain the specified permissions vCenter

    See: Migrateing vCenter new host

    Please allow points if you find this useful/correct

  • Connect physical hard disks to the virtual machine (and leave the data intact)

    Hello

    I'm looking to virtualize a SOHO headless server, that I use mainly for secure file storage.

    Currently, the system runs Linux installed on a small disc and has two drives 1.5 TB, used exclusively for data, in a cluster of ZFS mirroring. (I use the ZFS-fuse Linux-based application).

    I want virtualization for two reasons. One is to make administration easier and safer - avoid having to connect a keyboard and the physical monitor to the box from time to time. The other is that the machine is a bit more powerful to handle the load, and I'm hoping to make it work on other, more challenging tasks.

    Now, there is a catch. These discs are as highly important. I mean the data on them. What I need is to convert the current Linux system to a virtual machine, or re - install Linux on a virtual machine (don't like that), then connect the physical disks to the virtual machine as if they were actually connected.

    I certainly don't want to vmware touches those disks somehow.

    I've read the documentation, but I'm a noob when it comes to server virtualization and system engineering and don't quite understand if this is possible or not. These discs are not a SAN, they are physically connected to the server, I want to install vSphere on. (Of course, I'll log out when I run the setup of vSphere. But I need plug them again later, and they need to be sure that vmware will leave them alone and pass them to the virtual machine transparent.)

    Sigmoid wrote:

    Oh yes, the cluster mirrored ZFS. It is essentially a software RAID type thingie.

    http://en.Wikipedia.org/wiki/ZFS

    A material, or the point of view of virtualization, it appears two hard drives with a single huge partition on each that is not transparent to anyone, except the implementation of ZFS.

    OK, means that you can break the RAID, connect the drives to different host and configure RAID once again, right?

    Let's do it this way

    1. We will need a disc player more for VM, cause on flash, we install ESXi
    2. I will share ZFS :-), all you need to do with that before you install ESXi
    3. make the BACKUP!
    4. Disconnect the data host drives
    5. install ESXi 4.1 U1 free version on flash
    6. Download the site VMware vSphere client
    7. Connect the VM disk to ESXi
    8. customer help create the virtual machine and install the OS on it
    9. stop the virtual machine and esxi
    10. connect DATA drives to the ESXi host
    11. begin to ESXi
    12. See how to add RDM on youtube, after client use, change first hardware VM--> add a new hard disk--> choose Raw Device Mapping--> (physical or virtual) mode--> store it with folder VM - FACT
    13. Start the virtual machine, now your VM should see both drives, with good data course :-)

    I have just made this procedure (add ROW with data in Linux VM) on ubuntu VM, works well

  • Reports on virtual machines and their records

    I want to create a report on all my virtual machines and disks attached to each.  My preference would be to have the information in a .csv, so I can work with it in Excel.  What I've done so far has proved frustrating as I find it hard to combine the two.

    What I tried:

    1 VI Toolkit - I know I can run the command 'Get - VM' and "Get-hard drive" to get everything I need, but the combination of the two is beyond my current abilities of PowerShell.

    2 Report.ps1 of alanrenouf - gives a lot of information, but nowhere close to what I need.  I considered trying to modify this script, but I thought that it would take more time than learning how to make #1.

    3 OpenXMPowerTools - get this utility approach work still takes hours without result, more work than it's worth

    I have a few scripts (VBscript) skills, it is just their transfer in the new PowerShell environment for me I have difficulties with that.  I'm picturing extract names VM of the command Get - VM and then providing them to the hard disk-Get command and write VM name and output in the .csv file.

    Any help you can provide me with would be greatly appreciated to learn PowerShell.

    Thank you

    Joey

    Did you watch his pretty good RVtools and maybe gives you options of export or copied data and import it with excellent that.  Its very nice ESX administration tool.

    If you found this information useful, please consider awarding points to 'Correct' or 'useful '. Thank you!!!

    Kind regards

    Stefan Nguyen

    VMware vExpert 2009

    iGeek Systems Inc.

    VMware, Citrix, Microsoft Consultant

  • Migration of virtual machines to vSphere 4.1 to vSphere 6.0

    As the title eludes to, we are standing up a new physics 6.0 Server vCenter Server and need to migrate virtual machines of 4.1 6.0 guest hosts.  I'd love to take the time to create a script that does the following; However, before heading down this path, I wanted to do a ping of the group to see if someone has done something like this before or have pointers to scripts that perform some of these actions already.  Some background and concept:

    • Running 4.1.
    • A new physical Center of vCenter 6.0 will be deployed side-by-side with 4.1.
    • The existing configuration of vSphere HA allows for 1-2 guests down without impact to the virtual machines.
    • The two environment and will be Cisco N1KV, SAN access shared for the same data storages.
    • A new vCenter will be lifted.
    • A single host is identified and VMs evacuated to the remaining hosts.
    • This host will be in maintenance mode, removed from the cluster and close.
    • A clean install of ESXi 6 will be done and set up spec.
    • N1KV will be deployed.

    To digress on the details at the moment... Now markets PowerCLI desired.  This idea is ad hoc and on the fly, so as I write this.

    • identify all the virtual machines associated with a specific data store - will need to work with the local client to schedule downtime for virtual machines
    • Stop the virtual machine
    • Remove the VM of the vCenter 4.1 inventory
    • to connect to vCenter 6.0
    • Add the virtual machine to the vCenter 6.0 inventory (and once we have passed the first host in the new cluster, automatically place the virtual machine by using the DRS)
    • Reconfigure the vmnic with the new Cisco 1000V dvs (will be the same name on both sides, but has a different ID)
    • pull in the keys and the values to a CSV and advancedsetting set to harden
    • Turn on the virtual machine
    • Perhaps a test of ping for the NETWORK card to check connectivity

    The order in which the steps are performed can be switched around, as long as the desired end result is the same: migration effectively virtual machines between two disparate solutions with single medium sharing as a data store.  In which I realize will always be VMFS3.  New data stores VMFS-5 is another task for another time.

    Thank you for your time, suggestions, links, etc...

    @LucD - hi.

    These steps are quite possible with PowerCLI.

    See the script after skeleton, he probably needs some adjustments to fit your environment and requirements

    $dsName = "xyz".

    $vm = get - VM - $dsName data store

    Stop-VMGuest - VM $vm - confirm: $false

    Remove-VM - $vm VM - confirm: $false

    Disconnect-VIServer-Server vc41 - confirm: $false

    $vc6 = Connect-VIServer-Server vc6

    $newVM = $vm | New-VM - DiskPath $_. ExtensionData.Config.Files.VmPathName - confirm: $false

    # Suppose a CSV file with

    # Key, value

    # key1, value1

    # key2, value2

    $advSettings = import-Csv - UseCulture advSettings.csv

    {foreach ($obj in $newVM)

    $advSettings | %{

    Get-AdvancedSetting - $obj entity - name $_. Key |

    Game-AdvancedSetting - value of $_. Value - confirm: $false

    }

    }

    Start-VM - $newVM VM - confirm: $false

    $newVM |

    Select Name,

    @{N = "Available"; E = {Test-Connection - ComputerName $_.} Guest.HostName - County 1 - Quiet}}

  • Require a process step by step for the migration of virtual machines to new VMware ESX hypervisor

    Hello

    I'm looking for the method step by step for the migration of virtual machines to new host ESX Migration both cold and hot.

    Scenario - I have two data centers running ESX host stand-alone (with VM) in Europe. I need to build the new ESX host in new Dataceter to Singapore.

    Need prerequisites, the methods available for migrate VMWARE virtual has new host ESX (in the new data center) with minimum downtime.

    It will be great if you can enumerate the markets or redirect me to documentation that I can use to create detailed steps as the target host compatibility check on VMs and so on.

    Please advice

    Concerning

    AVI

    The steps are correct. The virtual machine must be turned off (step 3).

  • Migration of virtual machines in ESXi 4.1 to 5.5 to new hardware

    I'm new to VMware and our company bought 4 new servers and a SAN to replace our old VSphere 4.1 installation of 12 year.  The old configuration consisting of a server VCenter 4.1 physics 2003, 2 Dell 2900 ESXi hosts and 1 MD300i SAN.  Gen9 again the Installer 4 HP DL360 (3 host 1 VCenterServer) and MSA 2040.  Can someone please explain to me what would be the best way to go about moving more of our VM current for the new hardware? I found this from a previous post here, but it does not move the virtual machine to a SAN to another.

    Migration of the VMs of ESXi 4.x to 5.5

    "If I understand your question, continue to build the new environment of 5.5 with your 3 hosts from scratch 'ignoring' your old hosts. Once your new environment up & running, connect 4.1 guests to your new server vCenter Server and vMotion to move virtual machines while they run to the new cluster (live migration without interruption).

    VMTools upgrades do not have place automatically during migration.

    Once your virtual machines on new hosts, update tools as usual and you can then also upgrade virtual hardware of your virtual machines.

    Virtual HW update is optional, though; If you do not have the VMs that need the new features you can skip this last step and keep them as they are. »

    TYIA.

    The previous answer is pretty good, but I would like to add a few elements.

    You can 'disconnect' your 4.1 hosts of your old vcenter with running virtual machines, and then when you connect the hosts in your environment of 5.5 it will import your VM running as well.  As long as you have properly configured virtual networks you can live migrate vmfs old host and the old store of data simultaneously via the web client as long as your esx license allows it.  Otherwise close your virtual machines down to 1 at a time to migrate them above.

    Alternatively, you can consider running your vcenter as a virtual machine within the cluster it manages.  This gives you some DRS and HA for vcenter, plus a 4th host for virtual machines.

    If you don't have additional license you can also install your new hosts of 5.5 and run for 60 days before that you upgrade your 4.1 licenses to apply to your new host.

  • Is it possible to migrate a virtual machine between vcenter servers programmatically?

    Hi all

    My question is quite simple:

    -Is it possible to migrate a virtual machine between vcenter servers programmatically?

    Let's say we have two data centers:

    vcenter1

    -vm1

    -vm2

    vcenter2

    -vm3

    Is it possible to migrate vms between vcenter2 and vcenter1 programmatically? (or vice versa)?

    Also, I'm assuming that the appropriate VLAN and data warehouses across the different vcenters!

    Thank you

    Luis

    It is not possible, vMotion or migration live is in an instance of vCenter, it cannot be covered through two even if you have the data store accessible both vCenters and sets of the host. At best, you can unregister the virtual machine of vCenter 1 host and re-save as on vCenter 2 host, but once again, it is while the virtual machine is turned off.

    =========================================================================

    William Lam

    VMware vExpert 2009,2010

    VMware scripts and resources at: http://www.virtuallyghetto.com/

    Twitter: @lamw

    repository scripts vGhetto

    Introduction to the vMA (tips/tricks)

    Getting started with vSphere SDK for Perl

    VMware Code Central - Scripts/code samples for developers and administrators

    VMware developer community

    If you find this information useful, please give points to "correct" or "useful".

  • Possible to suspend a virtual machine, and then disconnect the SAN?

    I decided to do an interview on a small environment ESX 3.5 and I was wondering if its possible to suspend a VM and then disconnnect the SAN to maintain SAN.  If I record data suspends storage local would this work? Is it more fast and stop the virtual machine and the power save?  There is the performance of 6 virtual machines on a single host with a single iSCSI SAN.

    was wondering if its possible to suspend a VM and then disconnnect the SAN to maintain SAN.

    A suspension is identical to a power off, it shows just the guest to Hibernate.  So yes, it is safe.

    Is it more fast and stop the virtual machine and the power save? There is the performance of 6 virtual machines on a single host with a single iSCSI SAN.

    No its not faster, its more fast and more reliable to power off the virtual machine rather than suspend.  If you need to follow the process and suspend its critical use, otherwise a scheduled interruption is better.

  • Problem with Migration hot virtual machines Hyper-V

    Dear support

    I am facing problem in Live Migration of Virtual Machine in Windows 2012 of Hyper-V R2 cluster. Here are the details for my current setup.

    Two windows 2012 R2 Datacenter even care Server (HV01 and HV02) both in cluster

    A Virtual Machine created the Volume share of Cluster (c:\Cluster storage\...)

    A network adapter dedicated to the management of server-> 10.0.1.11 (HV01) and 10.0.1.13 (HV02)

    A network card dedicated to Hyper v Virtual Machines-> 10.0.1.12 (HV01) and 10.0.1.14 (HV02) and allow networking option is disabled.

    A network card for the heart beats-> 10.0.20.1 (HV01) and 10.0.20.2 (HV02)

    A network card dedicated for Live Migration-> 10.10.10.50 (HV01) and 10.10.10.51 (HV02) and chosen to be used only for the live migration fails on cluster network settings

    I added the Virtual Machine Cluster Failover successfully without error or warning. When I do a quick migration his works fine but when I do live migration his error giving 21502.

    Please update what's wrong with my setup

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • How do to activate 'VAPP Options' on an existing virtual machine, and then add the properties that will be passed down through the OVF - ENV. XML



    I'm trying to understand vSphere PowerCLI how to activate the "Options of VAPP" on an exsiting VM (in this case a model freshly cloned) then add properties and select cdrom of the FVO data access such as when the virtual machine is running the FVO - env.xml contains the properties in the CD-ROM drive.

    If I use the vSphere client and open the virtual machine settings and click on the tab 'Options' and then select "Options of VAPP" and change the setting to "Enabled" and then select 'VAPP-> Advanced Options' and click on the button 'Properties' on the right, I can add the properties and then I can change them vsphere PowerCLI, but given that these actions are not retained if I clone the virtual machine I need a way to put these in place of vSphere PowerCLI without using the vSphere client to do.

    Thanks in advance for the help!

    Mike

    You can use the vSphere API to activate the 'Options of VAPP"on an existing virtual machine, and set properties. For example:

    $spec = new-Object VMware.Vim.VirtualMachineConfigSpec

    $spec.vAppConfig = new-Object VMware.Vim.VmConfigSpec

    $spec.vAppConfig.property = new-Object VMware.Vim.VAppPropertySpec [] (1)

    $spec.vAppConfig.property [0] = new-Object VMware.Vim.VAppPropertySpec

    $spec.vAppConfig.property [0] .operation = 'Add '.

    $spec.vAppConfig.property [0] = new-Object VMware.Vim.VAppPropertyInfo .info

    $spec.vAppConfig.property [0].info.key = 0

    $spec.vAppConfig.property [0].info.classId = "Property1ClassID".

    $spec.vAppConfig.property [0].info.instanceId = "Property1InstanceID".

    $spec.vAppConfig.property [0].info.id = "Property_1.

    $spec.vAppConfig.property [0].info.category = "Property1Category".

    $spec.vAppConfig.property [0].info.label = "property 1.

    $spec.vAppConfig.property [0].info.type = "string".

    $spec.vAppConfig.property [0].info.userConfigurable = $true

    $spec.vAppConfig.property [0].info.defaultValue = "Property1DefaultValue".

    $spec.vAppConfig.property [0].info.value = «»

    $spec.vAppConfig.property [0].info.description = "Property1Description".

    $vm = get-VM-name vm3

    $vm. ExtensionData.ReconfigVM_Task ($spec)

  • Need to move virtual machines and power over the other ESXi HA and issues of Configuration of power

    Dears

    Need to move virtual machines and power on ESXi others using the HA and Power Options

    So what are the Options I need activate and deactivate:

    Turn on Vsphere HA

    Activate the tracking host

    Admission control (disabled)

    VM Machine Options

    VM restart priority (medium)

    Response from the host of off the power isolation

    VM monitoring (people with disabilities)

    Monitoring of (high) sensitivity

    Heartbeat of data store (select one of cluster data warehouses taking into account my preferences) of the data store is checked

    On each:

    Start/stop of the virtual machine is turned off

    Please indicate the required Options and on virtual machines, we are not turning on?

    Just to be clear, that VMware HA will only restart the VMS if ESXi hosts fails - or surveillance of the VM is turned on which will be monitors VMs will they crash or suspend and restart the virtual machine affected.

    and just to be clear, that the response of insulation parameter has nothing to do whther THAT HA will work or not - it does come into play if the ESXi host is isolated of the HA - Cluster

    xMotion works only between active ESXi hosts that can communicate with the server vCenter - and if the ESXi host broke down or became isolated and vMotion may not work.

    vMotion is automated with DRS that vMotion will a VM who need more resources to an ESXi host with enough reosurces.

  • How to migrate a virtual machine of vsphere vsphere 4 5

    I have a vsphere 4 and a 5 of vsphere, I want to migrate a virtual machine of vsphere vsphere 4 5

    my method is export ovf model and deploy the model of the FVO in vsphere 5, but it shows "end of file EGGS reached while looking for: * hard.

    How can I work my problem

    Thank you very much

    Hello

    Why are you trying with VMware Converter?

    https://my.VMware.com/Web/VMware/info/slug/infrastructure_operations_management/vmware_vcenter_converter_standalone/5_0

    It's the right tool for this kind of tasks/migration

    However, if you share with us details about your environment, we can help you more accurately.

    Concerning

Maybe you are looking for

  • Its has disappeared after the virus scan

    This morning, I did a virus scan on my computer and since then have been no noise.When I went into the Control Panel, it says that I have no sound driver... What should I do? I tried to perform a system restore, but unfortunately it was off and so un

  • Google maps report problem fails: sending automated messages

    When I submit a problem report, I get: "we're sorry: your computer or your network sends automated... answers. "It works well with IE and Opera but not Firefox. URL of affected sites http://maps.Google.com/

  • Visio 2013

    I can't activate.  I get a "" server temporarily unavailable"message and it is never available.

  • [Solved / resolved] Look And Feel (LAF)

    Buenos dias, tardes o noches muchachos! Explico a poco el tema: results as I am using United Nations LAF (Look And Feel) of manera mas especifica Synthetica BlueLight look and feel http://www.javasoft.de/synthetica/themes/Pero cuando ejecuto por prim

  • What is the problem on the image map in Dreamweaver CC2015?

    I did not in the property Panel command to map an image, they are unclickable.I import a mapped image from an another softwere (usually for this purpose) and the image is displayed with the reticular, but map of command in the Panel properties are di