script storage vmotion which move the config files too?

Hello

I have a VMWare admin for a long time but I am very new to the PowerCLI and script. I could find, modify and use scripts that do a simple storage vmotion: all disks go to a data store - but also one that can move independently - disk hard drive 1 to the data store X, hard disk 2 to the data store Y. However, I can't figure out how to recover the configuration files as well. I just got the book "VMWare vSphere PowerCLI reference", which confirmed my fears that you can't call these configuration files (and Exchange files, etc.) as a single parameter as you can hard drives. You use the SDK, that I have even fewer know that the CLI of power!

I keep my BONES (disc 1) files and configuration files in 'BONES' labeled data warehouses, so whenever I move a Hard Disk 1, I want to keep the configuration files, swap files, newspapers etc. with the OS disk file and move them to another "OS" datastore. No matter who else set up like this and already is figuring out how to automate this type of move? I know that I can move the entire VM to a data store, then move the hard drives 2 and above, but it's a waste of time and I have no OS LUN that are too big.

Thanks in advance for any help you can give!

Thanks for buying the book, I hope that you may find useful.

Yes, you are right, there is no single cmdlet that lets you move only the configuration files.

You can do this with the RelocateVM_Task method in the SDK however.

Such a script, in its simplest form, will look something like this.

$vm = Get-VM MyVM
$configDS =Get-Datastore -Name "MyDS1" $hdDS = Get-Datastore -Name "MyDS2"

$spec = New-Object VMware.Vim.VirtualMachineRelocateSpec $spec.Datastore = $configDS.Extensiondata.MoRef
Get-HardDisk -VM $vm | %{
    $hdSpec = New-Object VMware.Vim.VirtualMachineRelocateSpecDiskLocator    $hdSpec.Datastore = $hdDs.ExtensionData.MoRef
    $hdSpec.diskId = $_.Extensiondata.Key
    $spec.Disk += $hdSpec}
$vm.ExtensionData.RelocateVM($spec,"defaultPriority")

You specify the destination of the files "config" in the line of $configDS.

Hard disks will be migrated to the data store that the script gets in $hdDS.

If you want to only move the configuration files, you specify the same data store to which they are already for hard disks.

$vm = Get-VM MyVM
$configDS =Get-Datastore -Name "MyDS3" $hdDS = Get-Datastore -Name "MyDS2"...

Tags: VMware

Similar Questions

  • How to move the index file...?

    I have files of data to index as follows...

    /U02/MY_TEST_DATA/indx01.dbf
    /U02/MY_TEST_DATA/indx02.dbf

    I'm running out of disk space available in u02.

    How to move the two files above to u03? I have a lot of space in u03.
    HP Unix, Oracle 10g R2.

    What I need to change other settings when I move the location of the file? for example, backup, archieve etc...

    Please advice.

    Thank you
    GISH

    Hello..

    Well you can do it in one of 2 ways: -.

    1 put the tablespace contains the data offline files, copy the data index files to the new location, and then change the database rename ' old/file/name/location of the file' to 'new/file/name/locatio. put storage space online. Completed successfully, remove the file data from the old location.

    2. in the hope that these two data files belongs to 1 tablespace and tablespace that contains only the index, you can create a tablespace with its data on the new mountpoint file again, then rebuild the index of aid (dynamic script)

    change owner.index_name tablespace new_tbs_name n parallel reconstruction;

    Once all the indexes have been moved to the new tablespace you can drop the previous old tablespace.

    I would prefer 1.

    HTH
    Anand

  • Firefox 6 need to move the cache (files temporary folder) to a specific file

    Hello I need to know how to move the temporary file for firefox folder 6. I managed to do it easily for IE as it can be done from the settings tabs for firefox but, I need to access the topic: config so I understand. However after that I implemented browser.cache.disk;D:\Temporary Internet Files and browser.cache.offline;D:\Temporary Internet Files, nothing seems to happen like firefox still uses the original place

    Pref is correct browser.cache.disk.parent_directory - does not exist by default, the user needs to create.

  • How do I have to move the index file so it will end up the rest of the files indexing?

    CS6 as file are loading it stops, indexing to a certain xml file which is non exsistant in the project... How do I have to move the index file so it will end up the rest of the files indexing? Is there a way to get the file that will not index?

    Post edited by: Kevin Monahan Reason: title was too long

    Indexing stops when you open the CS6 project

  • How to move the MSWMM files and keep the data on my computer?

    I downloaded digital film from my camera to a destination on my D drive as a file MSWMM (collections), and whenever I try to move the downloaded film (collection), it does not recognize the movie more.

    How to move the MSWMM files and keep the data on my computer?

    The mswmm file is the project file, not a video.
    Think of it as a recipe for a cake, it only tells you what to do with the ingredients, but does not include the ingredients.
    The mswmm file tells the computer to look in a certain folder to use a video or audio file.
    If you move the file, then MM knows not where is the file, then you must tell it, by right clicking on a red x on the timeline and then choose search for the file.

  • Y at - it a keyboard shortcut, which moves the item target upward and down channels?

    Y at - it a keyboard shortcut, which moves the item target upward and down channels?

    Open KBSC and type UP (or DOWN) in the search.

  • I just put my account on a new PC dreanweaver... now I can't update the site.  Do I have to manually move the index file?

    I just put my account on a new PC dreanweaver... now I can't update the site.  Do I have to manually move the index file?

    There is no function in DW or creative cloud to put your files of the actual location of a computer to another.

    If you are using a new computer, you will need to make a copy of the real site files and bring them to class, or create a site empty on the new machine, using the current FTP information and click on down (the arrow in the files window icon) files from the server for making new copies on your new machine.

  • When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Adobe first Pro 2015 CC only!

    When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Adobe first Pro 2015 CC only!

    Please make sure that the audio and video tracks are highlighted.

  • In version10.1.5 how I would break down a large PDF file and then save each page which is the biggest file?

    In version10.1.5 how I would break down a large PDF file and then save each page which is the biggest file?

    If you mean Adobe Reader 10.1.5 (you tell what you have) then you can't. This would require the full version of Acrobat.

  • When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Thank you for your help in advance

    When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Thank you for your help in advance

    You must set the source patch:

  • How to move the snapshot file

    Is there a way to move the snapshot files to some other hard disk partition?

    I'm running out of space on my hard drive partition wherer my VM resides, only option I have available is to remove my shot, I don't want to.

    Any suggestion?

    You must edit the vmdk and vmx - if it works by simply changing the vmx you do something I don't understand ;-)

    ___________________________________

    VMX-settings- WS FAQ -[MOAcd | http://sanbarrow.com/moa241.html]- VMDK-manual

  • Storage vMotion fails with the error below

    I'm trying to run a virtual machine's storage vMotion. It fails with the error below.

    This method is disabled by 'moref = 17705'

    #1 method - manually remove the entry from the VCDB.

    • Stop the Service of VC.
    • Connect to the SQL Instance.
    • Run the SQL for VCDB.
    • Select * from VPX_VM WHERE name LIKE '% VM_Name % '.
    • Note the ID of VM in column 1.
    • Validate the stale entry.

    Select * from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = "vm - ID".

    • Remove obsolete entries.

    delete from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = "vm - ID"

    • Start the VC service.
    • Try Storage vMotion.

    Method #2-si this does not work, save the *.vmx file once again which will fix the problem.

    Note: To do this, you will be required to server unavailability.

    • Power off the virtual computer.
    • VM unregistered inventory.
    • Navigate to the path of the data store and VMX re-register.
    • Start the virtual computer.
    • Try Storage vMotion.
  • vCenter Server - rename the config files and moving datastore

    Our vCenter VMware Server (4.1.0) is a virtual machine. The vCenter Server database is stored on a SQL Server that is also a virtual machine. The configuration files for the server vCenter and file a vmdk are located on a data store and the other vmdk file is located on another data store. This isn't a problem, but the parent folders that store these files have different names and do not reflect the name of the vCenter Server VM. Also the names of configuration files are different for the vmdk file names. I would like to move and rename files vmdk my vCenter Server to another data store and all the configuration files so that the parent folder that stores all the files has the same name as my vCenter Server VM and all of the files in the folder are on behalf of my vCenter Server VM.

    What would be the best way to do this? Can I install the stand-alone converter on the vcenter Server and migrate the server? I have a vCenter Server Standard license. Thank you.

    as above, use storage vmotion if possible else, you can use vmware converter...

  • Storage vMotion GUI in the roadmap - individual placement of discs?

    I use storage vMotion the remote CLI much and I use almost exclusively the function to simply move some disks and leave some wherever they are. I saw the video demo of the user interface provided and it seemed to make a gesture of any disk group, just like the non-Plug-in support for Virtual Center did. Does anyone have knowledge of defining targett if different volumes of individual disk in the new GUI?

    Yes, click on the Advanced button. Then you can choose the target for each disc.

  • Move the data files in a server

    Hello

    I am faced with the situation that a customer needs to move their 10 g-server instance, i.e. to a different disk subsystem, and then a similar movement will be on the 11g on the same server instance. The problem is that the downtime on the instances should be minimized.

    My plan is (for a tablespace at a time):
    * make the tablespace read only
    * Copy data files to the new location
    * offline tablespace
    * alter tablespace rename datafile 'original file name' to 'new file name ";
    on the line the tablespace read write
    and when it is, I will continue with the journal, tablespace and control files temporary.

    Now to the twist and my question: the customer has separate tablespaces for tables and indexes.
    My concern is what is happening to the index if the tablespace containing these are read-only, and storage with the tables are read/write? The transaction fails, because the index cannot be updated, or the index will become damaged?

    Am I better off marking the tables and index tablespaces read only at the same time, ensure the integrity of the database? Or is there a completely different and way better to travel?

    The system is running on a Redhat server.

    Brgds
    Johan

    Johan Nilsson says:
    Hello

    I am faced with the situation that a customer needs to move their 10 g-server instance, i.e. to a different disk subsystem, and then a similar movement will be on the 11g on the same server instance. The problem is that the downtime on the instances should be minimized.

    My plan is (for a tablespace at a time):
    * make the tablespace read only
    * Copy data files to the new location
    * offline tablespace
    * alter tablespace rename datafile 'original file name' to 'new file name ";
    on the line the tablespace read write
    and when it is, I will continue with the journal, tablespace and control files temporary.

    Now to the twist and my question: the customer has separate tablespaces for tables and indexes.
    My concern is what is happening to the index if the tablespace containing these are read-only, and storage with the tables are read/write? The transaction fails, because the index cannot be updated, or the index will become damaged?

    Am I better off marking the tables and index tablespaces read only at the same time, ensure the integrity of the database? Or is there a completely different and way better to travel?

    The system is running on a Redhat server.

    If storage of the index could be read-only, then the index tablespace would lift error if the ar of paintings will be moved.

    [oracle@edlvc1r15p0-orcl trace]$ sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 1 19:36:33 2011
    
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Automatic Storage Management, OLAP, Data Mining
    and Real Application Testing options
    
    SQL> drop tablespace test_bkp including contents and datafiles;
    
    Tablespace dropped.
    
    SQL> create tablespace test1 datafile '/u01/app/oracle/test1.dbf' ize 10m;
    create tablespace test1 datafile '/u01/app/oracle/test1.dbf' ize 10m
                                                                 *
    ERROR at line 1:
    ORA-02180: invalid option for CREATE TABLESPACE
    
    SQL> c/ize/size
      1* create tablespace test1 datafile '/u01/app/oracle/test1.dbf' size 10m
    SQL> /
    
    Tablespace created.
    
    SQL> c/test1/test2
      1* create tablespace test2 datafile '/u01/app/oracle/test1.dbf' size 10m
    SQL> c/test1/test2
      1* create tablespace test2 datafile '/u01/app/oracle/test2.dbf' size 10m
    SQL> /
    
    Tablespace created.
    
    SQL> conn aman/aman
    Connected.
    SQL> drop table t purge;
    
    Table dropped.
    
    SQL> create table t as select * from scott.emp ;
    
    Table created.
    
    SQL> select table_name, tablespace_name from user_tables where table_name='T';
    
    TABLE_NAME                     TABLESPACE_NAME
    ------------------------------ ------------------------------
    T                              USERS
    
    SQL> alter table t move tablespace test1;
    
    Table altered.
    
    SQL> create index tidx on  t(empno) tablespace test2;
    
    Index created.
    
    SQL> alter tablespace test2 read only;
    
    Tablespace altered.
    
    SQL> insert into t select * from t;
    insert into t select * from t
                *
    ERROR at line 1:
    ORA-00372: file 7 cannot be modified at this time
    ORA-01110: data file 7: '/u01/app/oracle/test2.dbf'
    
    SQL> 
    

    That said, if I have understood correctly, you want to move the database and the 'clone' on the new server. Is this right? If so why not make the backup of the 10g database and use it to create a clone/copy of the database on the new server?

    Aman...

    Johan

Maybe you are looking for

  • steps in reinstalling photo library

    I reinstalled my system because of a problem Apple engineers could not resolve. Because there all night to reinstall my pictures I didn't do it with Apple Care support. Can you give me the steps to install my photo library of time capsule?

  • multitasking bug

    I don't know if it really happens with you all, but I feel some sort of bug when I try to type on the multitask screen on my motorcycle g button (no LTE, android version: 4.4.4).) Sometimes, when I type the multitasking button, it shows the applicati

  • Unflattening a binary string of basket

  • Silverlight protects videos from netflix from downloading movies on their computer?

    Silverlight video security I am creating a video subscription website; set up like netflix.com.  Silverlight protects videos from netflix from downloading movies on their computer?  Where can I get more information about Silverlight video? Thank you

  • Upgrade CPU Compaq 6715 b

    As stated above, Can I upgrade my CPU or is it is soldered on the motherboard? If can upgrade, can I know what are the elements that are compatible with this old laptop? Thank you. My laptop stats: Compaq 6715 b Windows Vista SP 1 (cannot install SP2