to a different vm datacenter

I tried to move a virtual machine from one data center to another. The destination has 2 clusters hosts, each with multiple hosts. All hosts to connect to the same cluster of data store.

Tried, but got an error: must be on the same data center:

$vm | Move-VM-Destination $vmHost - Datastore $ds

But if I tried - Destination as an object $datacenter, PowerCLI na not raise an error:

$vm | Move-VM-Destination $datacenter - Datastore $ds

However, the when I looked the vSphere Client, it showed an error:

The operation is not supported on the object.

What is the best way to move a virtual machine to a different datacenter?

The alternative is to use the RelocateVM_Task method.

Something like that

$vmName = "TestVM"$tgtDatastore = "datastore"$tgtCluster = "cluster"$tgtPool = "resourcepool"

$vm = Get-VM -Name $vmName$ds = Get-Datastore -Name $tgtDatastore$esx = Get-Cluster -Name $tgtCluster | Get-VMHost | Get-Random$rp = Get-ResourcePool -Name $tgtPool

$spec = New-Object VMware.Vim.VirtualMachineRelocateSpec$spec.Datastore = $ds.ExtensionData.MoRef$spec.Host = $esx.ExtensionData.MoRef$spec.Pool = $rp.ExtensionData.MoRef$vm.ExtensionData.RelocateVM($spec,"defaultPriority")

Tags: VMware

Similar Questions

  • Mulitple different VM Datacenter migration.

    Hi all

    Here's the scenario:

    We are moving data centers, and we need to migrate several VM which varies 10 GB up to 3 TB over several data stores.

    The solution that we are trying to test is using iSCSI LUNs replication and register the virtual machine on the hosts on the new data center.

    Before we can attempt to copy LUNS I have the following questions:

    (1) all VM will be closed down and over the copy of lun. I have to remove the VMware data store?

    (2) if I don't then how remove the data store while preserving the data? The data store remove preserves data?

    Thanks in advance

    Mike.

    You copy the whole data LUN/store and the new data store is connected to different ESX servers?  If sufficient Yes, seen at the bottom of the virtual machine. Logical unit number to destination will be re-signing of course as they will appear on the remote ESX servers that clones. If you have not done this before make sure you understand the process, essentially the ESX remote will not mount new volumes that it adopts a cautious approach would be a replica of a knowledge pre-existing LUNs in the case where the data store is moved, but the ESX servers are shared between sites. If you simply copy LUN virtual machine (VMDK files) this wont be a problem or issue.

    dB

  • How to define Customfields Datacenter?

    Hello

    I want to add custom data center view fields, when I do it for the hosts and virtual machines, it works very well, but to the data center, it does not work,

    is it possible to do?

    Thanks in advance

    Yes, you can add custom data center view fields. The only problem is that you won't see them in the vCenter client. This seems a restriction of the client vCenter for me. But you can use them in PowerCLI.

    Following PowerCLI script adds a custom field named location to view data center. It then retrieves the first data center. Returns the value of Amsterdam in the area of the location of this data center. And finally retrieves all the fields that have been customized for this data center.

    New-CustomAttribute -Name Location -TargetType Datacenter
    $Datacenter = Get-Datacenter | Select-Object -First 1
    Set-Annotation -Entity $Datacenter -CustomAttribute Location -Value Amsterdam
    Get-Annotation -Entity $Datacenter
    

    If you use the cmdlet New-CustomField instead of the cmdlet New-CustomAttribute syntax is slightly different:

    $Datacenter = Get-Datacenter | Select-Object -First 1
    New-CustomField -Entity $Datacenter -Name Country -Value "The Netherlands"
    Get-Annotation -Entity $Datacenter
    

    Best regards, Robert

    Added example of New-CustomField.

    Post edited by: RvdNieuwendijk

  • Move VM between data on the same vCenter centers

    Hey all the...

    With a virtual machine off, I'm migrating a VM between data centers in the same vCenter. There is no shared storage, different networks to the destination host. The user interface works (caveat about the missing shows destination network), yet move-vm does not work between data centers.

    By train: move-vm - vm test-20150309 - destination esx1 datastore - datastore1, I get the error:

    Move-vm: 09/03/2015-14:48:20 Move - VM Destination container must be in the same data center.
    On line: 1 char: 1
    + move-vm - vm test-20150309 - destination esx1. ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo: InvalidArgument: (esx1:VMHostImpl) [Move-VM], VimException
    + FullyQualifiedErrorId: Client20_VmHostServiceImpl_CheckMoveVmParameters_InvalidDatacenter, VMware.VimAutomation.
    ViCore.Cmdlets.Commands.MoveVM

    The manual States -Destination can be file, host, cluster etc... As the hosts AND records are bound by data centers, I guess it must know the new host & the new folder. I tried to use - destination twice, and I've tried - destination host, folder.

    Move-VM: cannot bind parameter because the 'Destination' is specified more than once. To provide several parameter values that can accept multiple values, use the table syntax. For example, '-parameter value1, value2, value3 ".

    Move-VM: missing an argument for the parameter "Destination." Specify a parameter of type 'VMware.VimAutomation.ViCore.Types.V1.Inventory.VIContainer' and try again.

    I used PowerCLI 5.8 and tried on 5.0 and 4.0 vCenter.

    Move-vm: 09/03/2015-14:48:20 Move - VM Destination container must be in the same data center.
    On line: 1 char: 1
    + move-vm - vm test-20150309 - destination esx1. ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo: InvalidArgument: (esx1:VMHostImpl) [Move-VM], VimException
    + FullyQualifiedErrorId: Client20_VmHostServiceImpl_CheckMoveVmParameters_InvalidDatacenter, VMware.VimAutomation.
    ViCore.Cmdlets.Commands.MoveVM

    The SDK method works?

    See 3. Re: to a different vm datacenter 

  • copy the folder between virtual centres

    What is the fastest way to copy a folder of models one vcenter to another vm?

    I think the best way would be to export to the FVO and import it into the new VCenter or use SCP from host to host.  If it's a different cluster/datacenter in the VCenter even, you can rotate upward and then reset the network label.

    Here is an article on the copy between hosts ESXi (which wouldn't matter at this point on VCenters):

    http://KB.VMware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalID=1005810

    It will be useful,

    Eric

  • Windows Server 2012 R2 Datacenter - "we couldn't complete updates of changes to undo; do not turn off your computer.

    There are approximately 247 updated to do with this Windows Server & as before in the past w / various different OS that I discovered that these must be mounted separately & batch too for these works correctly!

    There must be - a kind of server 2012/r2 cumulative hotfix / service pack that will sort most of these problems of updates w / a download link for getting these!

    But how & in which updates of the batch/grna they do have to do to finish correctly without these issues and so on!

    example"separate updates like this should be done in separate lots and so on!

    (a) Internet Explorer updates

    (b) .NET Framework 4.6

    (c) KB * item updates made in various lots of diferent etc.

    Thanks a lot for your help as it is very much appreciated! A little more the last hours of your answer I had actually beta tested who follows & found that if you keep w / the following it works actually & w/out any error!

    ***************************************

    Windows Server 2012 R2 Datacenter - updates!
    Manually set the updates of Windows Server R2 Datacenter 2012 as follows"
    ' Check for updates but let me choose whether to downloadand install them.
    ***************************************
    (c) Finally,... There are several optional updates to do that must also be separated for installs them!

    1 Microsoft Silverlight (KB3182373)

    6 update to Windows Server 2012 R2

    "(b) s @ less (233) KB * important updates that should be made in separate batches of selected manually - from a @ bottom & goes to the high c as follows.

    119 for Windows Server R2 2012
    98 security Update for Windows Server R2 2012
    1 acumulative Security Update for Internet Explore 11
    1 cumulative reliability for Microsoft .net 4.6
    1 security Update for Microsoft ASP.NET
    13 4.6 .net Framework

    (a) there were several original KB * updates manually, I downloaded & installed directly from the "Microsoft Download Center" w / some which are detailed below.

    1 Windows Server 2012 R2 Update (KB2919355)
    1 update to Windows Server 2012 R2 (KB2883200)

  • Mix the virtual switch different type in a Cluster and a data center.

    Can I mix standard virtual switch and a virtual switch distributed in different hosts to a Cluster/DataCenter? Can I vMotion virtual machine to a host of switch distributed to a host of standard switch and vice versa? Let's assume that the hosts have the same port group name (but have virtual swaitch different type), in the same data center, and have the same subnet IP vMotion.

    You can mix standard switches and distributed, that's what we call hybrid architecture... but to be able to migrate virtual machines between virtual switches, you must the vSphere 6 and again there are some limitations, like not be able to migrate from VDS vs.

    Have a look here for more details on the cross switch vMotion: http://www.vladan.fr/vmotion-enhancements-vsphere-6-0/

  • VRM is. Still available to vRA 6.2 DataCenter.Location custom properties?

    Hi all

    I need to create a plan to allow users to select 2 different vcenter/geo then dropdown sites only a list of cluster dependency based on vCenter.

    Then I ran into the same situation, here is how I fixed it.

    1. Update your file xml places the names of your data centers
    2. Assign to the resource calculation, that you want them to go too.
    3. In your dictionary of properties create a field called Vrm.DataCenter.Location, in this area, add the same data center location names that you used in the xml file.
    4. Add it to your disposal of property
    5. Then you can add it directly to your plan or create a profile of construction (which I did) to assign to the EHR Architecture.

    That's close enough, if you use vCO to do any customizations before construction, the value of Vrm.DataCenter.Location get more written disposition.

  • Specifying the location of the cluster with several folders (same name, different hierarchy)

    I am able to create a cluster and place it in a folder. However, I don't know how to set it for a specific folder when there are several folders with the same name across different hierarchical depths.

    For example, suppose I want to create a cluster in the Department of human resources:

    New-Cluster -Name Cluster1 -Location (Get-Folder HR)

    Then assume that a HR folder is created on several issues, such as the following:

    Datacenter-Corp.-HR
    Data Center-NY-HR
    Data Center-CA-HR
    ...

    I could then create the cluster in the Department of human resources of NY:

    New-Cluster -Name Cluster1 -Location (Get-Folder NY | Get-Folder HR)

    But what can I do if this depth is not standardized or changes, such as the following:

    Datacenter-Corp.-HR
    Data Center-East Coast-NY-HR
    Data Center-West Coast-CA-HR
    ...

    Is it possible to see this full path, regardless of the depth of existing clusters?

    How can I create a new cluster in a file which can be of various depths and have the same name?

    Thanks for any help.

    You can go down the road with the following script.

    At the end the variable $fld contains the final location of the path and you can make a New-Cluster - location $fld

    $folderPath = "Datacenter\West Coast\CA\HR"$fld = $null$folderPath.Split('\') | %{    if($fld){        $fld = Get-Inventory -Name $_ -Location $fld -NoRecursion    }    else{        $fld = Get-Inventory -Name $_ -NoRecursion    }}
    
    $fld
    
  • VMware ESX 4.0.0 in connection mit Windows Server 2008R2 Datacenter (4cpu) - license

    Hallo zusammen!

    I have several questions zu obigem Sachverhalt und hope, dass mir von Euch helped werden kann.

    Wir haben einen host ESX (VMware ESX 4.0.0) den wir via vSphere von einem Windows Server aus, verwalten. Auf dem ESX host wollen wir nun start, die first VM (ins Leben zu find) zu installieren. ES sollen OS installed werden (. ser on W2K3 / W2K8 STD (R2), company / business,...).

    Wir haben also license so: 'Windows Datacenter 2008 R2 64 bit 4 CPU. After we die erste VM installed haben, wanted sharp wir mit dem Lizenzkey der Datacenter license aktivieren. Unfortunately works weder der 'Product Key', noch der 'Virtual Key'.

    WO ist mein Denkfehler? Wie die of ich lizenzsiere auf einem host ESX VM procedures meiner Datacenter license Windows-VM?

    Email ich einen KMS Server?

    Bitte um Hilfe - Danke und Grüße TIM

    Auf einem Windows-Server further

    Ich habe einen Server Hello understand before mit 4-Prozessoren (mit neuankömmlinge bis zu 6 carrots?) und eine MS Datacenter 2008R2 as 4 processors so.

    Wenn nun auf dem vShere Installierst werden die Datacenterlizenzen dem host "OS are" Host the kannst und so many different Windows Server verschiedener color installieren, wie die Maschine these.

    (Die dabei "freiwerdenden licenses können as physical system recycled werden...)

    Die Lizensierung participations eher als "Zuweisung" - stell dir vor, die of the DC licenses klebst an den Server und damit Maschine lizensiert ist die mit data center.

    The Add Installation Aktivierung paper - die Zuweisung hands oder keine.

    Bei einer Aktivierung eines W2K8 STD. servers add to the (ublicherweise) einen VLC (VolumeLizenzKey) der eine unlimitierte Aktivierung allows.

    Wenn nun keinen VLC As, so wende Dich an den suppliers der DatacenterLizenz oder direkt from MS. Mit den entsprechenden Lizenzpaieren und Kaufbelegen solltest VLC key bekommen die.

    VIELLEICHT kannst noch something konkreter werden, um welche Art DC license are all und wie bisher deine Server aktiviert Hat sich (OEM, VLC, detail mit Select vertrag, SystemBuilder...) - eine Systembuilderlizenz ACE falls.

    BTW. a hindert dich daran, every Server STD als eines virtual system einen Datacenter zu installieren? OB deine nun auch STD oder doch keine Rolle spielt so DC application.

    Wenn einen planned Server ACE, den draufklonst oder geckoos193, der dann neu aktiviert werden will ists auch kein problem.

    Einfach aktivieren und ggf. uber die Aktivierung go book.

    If you have found this device or any other answer useful please consider useful or correct buttons using attribute points

    Also on 11-08-2011.

    http://www.Microsoft.com/windowsserver2008/en/us/downgrade-TC.aspx

    Post edited by: newmy

  • What is the best hisrarchy for our datacenter?

    Hi Frienz,

    What is the best for our datacenter hierarchy?, like DVM or Department wise wise different OS?

    A better plan, you have thenplease to share with me.

    Kind regards

    Rashid

    Hi rachid,.

    The answer to your question depends on what makes your organization and how you intend to use ESX. I work for a large school district, and I've broken down our Datacenter hierarchy based on the fact that we have 3 physical data centers. All three are controlled from Virtual Center. Below these, I created pools for our desktop computers and servers. Sub-folder of our offices, there is a folder for each school. Inside this folder, work stations are organized by staff and students. This hierarchy as well as our VM naming convention helps us keep track of hundreds of virtual machines, we have running in our data centers.

    In summary, the way you organize your files in VC is completely up to you but the choice of a method that makes sense for everyone is the key.

    Ty

  • SE connect-viserver to remain persistent through different functions.

    For some reason, I can't get my Virtual Center connection to remain persistent so I can use in a different function when the connection is in service.  If I perform other tasks in the same function as the "Connect-VIServer" then they work without any problem.  I know I must be missing something.  Two examples of code base of what I'm trying to do.

    Code

    function connectVC

    {

    SE connect-VIServer $vcserver

    }

    function showdatacenters

    {

    Get-data center

    }

    Add-PSsnapin VMware.VimAutomation.Core

    Initialize - VIToolkitEnvironment.ps1

    $vcserver = read-host 'Target VirtualCenter Server'

    connectVC

    showdatacenters

    Error

    2009-05-07 15:51:22 Get-data center you are not currently connected to all servers. Sign in first using Connect-VIServer or one of his pseudonyms.

    To: tank line: 7:15

    + Get-Data Center & lt; & lt; & lt; & lt;

    Code

    function connectVC

    {

    $objVC = to connect-VIServer $vcserver

    }

    function showdatacenters

    {

    $objVC.------

    Get-data center

    }

    Add-PSsnapin VMware.VimAutomation.Core

    Initialize - VIToolkitEnvironment.ps1

    $vcserver = read-host 'Target VirtualCenter Server'

    connectVC

    showdatacenters

    Error

    The argument cannot be null or empty.

    To: tank line: 7:24

    + $objVC.

    Get-data center & lt; & lt; & lt; & lt;

    Is the reason that you see, it is because of the "scope" in which you connect to the VC server.

    While in a function (connectVC in your first example), local variables you create are lost when you leave the service.

    There are 2 solutions

    1) connect to the VC server outside of a function, the scope of the script called

    
    function showdatacenters
    {
    Get-Datacenter
    }
    
    Add-PSsnapin VMware.VimAutomation.Core
    Initialize-VIToolkitEnvironment.ps1
    
    $vcserver = read-host "Target VirtualCenter Server"
    Connect-VIServer $vcserver
    showdatacenters
    

    (2) store the ViServerImpl object (which is returned by the cmdlet Connect-VIServer) outside the function and pass on all other VITK cmdlets.

    
    function connectVC
    {
    $global:vc = Connect-VIServer $vcserver
    }
    function showdatacenters
    {
    Get-Datacenter -Server $global:vc
    }
    
    Add-PSsnapin VMware.VimAutomation.Core
    Initialize-VIToolkitEnvironment.ps1
    
    $vcserver = read-host "Target VirtualCenter Server"
    connectVC
    showdatacenters
    

    If you want to learn more about scope modifiers (like the World Cup, I used 2)), take a look at this.

  • Passing a datacenter ASM disks to the other for the other machine

    Environment: 4 node RAC
    Version: 11.1.0.7
    Storage: ASM (Oracle ASM library)
    DB Dimensions: 3 TB

    We need to move the database to a different datacenter of high-powered servers (more cpu & ram & different brand).

    If we closing the db and disks are moved from the data center A to b. can easily turn us on these starts on the servers in the data center in B?


    I guess that's possible... so after the disks are moved to data center B. From the point of view oracle, just need to ADD the ASM_DISK_GROUPS parameter name diskgroup and mount?

    user8860934 wrote:

    If we closing the db and disks are moved from the data center A to b. can easily turn us on these starts on the servers in the data center in B?

    ASM labels are written on the disc itself. If all disks in a diskgroup in ASM are intact and compatible version wise with this instance of the DSO, this instance can mount the diskgroup.

    I guess that's possible... so after the disks are moved to data center B. From the point of view oracle, just need to ADD the ASM_DISK_GROUPS parameter name diskgroup and mount?

    Yes. Also assuming, on the side of the o/s physical, ASM has the required access on these discs.

    Beware of the how the disks are moved however. If these discs are 'affected unduly' by the admins of storage when the zoning/LUN masking/that it is them, they will corrupt the data on it - and ASM will be unable to use these discs.

  • Why is apple tv (4th Gen) using subnet different comcast

    I need to figure out if there is anything special/different regaurding how ATV (4th Gen) made the resolution DNS when wired to a Comcast cable modem only (no wifi and no router)?  I notice that my ATV selects a different subnet when ATV is set automatically resolve IP and DNS.  Example of my Dell PC Tower and Sony laptop automatically use a subnet of 255.255.255.0, but ATV uses the example below:

    67.166.208.26

    255.255.252.0

    router 67.166.208.1

    ATV works great just need to know why to solve network problems not related to my home office network and at home?

    Hello. You say there is no router, but I guess that the Comcast modem is also a router and DHCP server. Are you using IPv6? You use a static IP address?

  • I have iphone 5 c. I've updated new version 10.0.2. Now Weather app is working for different cities but does not not for my site which has already been demonstrated in latitude and longitude. Similarly maps application also does not work for my site

    I have iphone 5 c. I've updated new version 10.0.2. Now Weather app is working for different cities but does not not for my site which has already been demonstrated in latitude and longitude. Similarly maps application does not also work for my site.

    Settings > privacy > location Services > confirm you always give permission to these applications to use your location.

    If not, try these standard troubleshooting steps.

    -Reset: hold the Home and Power buttons until you see the logo Apple (10-15 seconds).

    -Restore your iDevice: https://support.apple.com/en-us/HT204184

    If your backup is in iTunes, make sure that it is encrypted.

Maybe you are looking for

  • How can I get the status bar on my web page

    I want to get the status bar at the bottom of the web page so that I can slide from left to right, if an article is too large for my monitor. I got it this morning 05/01/15. After Thunderbird as an option for my email, the bar disappeared after unins

  • Where to buy caddy for upgrade Bay?

    Looked everywhere, but have not found a HP shopping cart into my 2nd hard drive Bay upgrade. The only thing I find is to buy a hard drive with a Bay (at least that what it's, very little info on this 'product'). What I really need to order a basket n

  • Microsoft net framework 3.5 sp1 fails during setup error microsoft visual studio code 1603 event 8

    installation failure installation of visualstudio8 of type event P1: 35101 P2: 23.5.30729.01_orcas_x86_net P3: mc P4: inst P5: f P6: ca_installassemblydef.3643236f_fc70_11de_a536 P7: 0 P8: 1603 P9:. P10: gencomp760_ {12cd included files are c:\DOCUME

  • Printer HP PhotoSmart C309g print is no longer black text, graphics, etc.

    Hello: We have a HP laptop. We have a C309g wireless HP PhotoSmart all-in-One printer/scanner/copier. It has worked very well for a few years, until 2 days ago. It allows to print is no longer in black (colors and black Photo work very well). We have

  • Beats Audio Software missing on Pavilion dv6 - 2430M

    I accidentally uninstalled IDT Audio Driver on my HP Pavilion dv6 2430 M then the audio icon of the beast disappeared. I was able to reinstall the audio driver but the audio of the beast is still missing. How can I get that back?