Data warehouses up-to-date for a pool of VMware using PowerCli

Using this as a starting block.

VMware View 5.2 Documentation Library

I want to combine both functions and the variables to use ".txt files" with my new and old data warehouses listed.

I edited a bit, combining both functions and variables for lists old and new creation, but I don't know about the context to provide variables for text files.  All PowerShell / PowerCli guru?

# Function PowerShell to add new, then remove the old warehouses of data in an automatic pool.

# UpdateDatastoresForAutomaticPool

# Parameters

# $Pool ID of the pool pool to update.

# $OldDatastore full path to OldDatastore.txt to be removed.

# $NewDatastore full path to NewDatastore.txt to add.

$Pool = "C:\powercli\PersistentPools.txt".

$OldDatastore = "C:\powercli\OldDatastore.txt".

$NewDatastore = "C:\powercli\NewDatastore.txt".

function RemoveDatastoreFromAutomaticPool

{param ($Pool, $OldDatastore)

$PoolSettings = (get-pool-pool_id, $Pool)

$currentdatastores = $PoolSettings.datastorePaths

$datastores = «»

foreach ($path in $currentdatastores.split (";"))) {

If (-not ($path - eq $OldDatastore)) {}

$datastores = $datastores + "$path;"

}

}

Update-LITERALLY-pool_id, $Pool - datastorePaths $datastores

}

function AddDatastoreToAutomaticPool

{param ($Pool, $NewDatastore)

$PoolSettings = (get-pool-pool_id, $Pool)

$datastores = $PoolSettings.datastorePaths + "; $NewDatastore ".

Update-LITERALLY-pool_id, $Pool - datastorePaths $datastores

}

Thank you

-Matt

You use literal strings instead of the content for the files. Assuming that the contents of the file is a list with one entry on each line, you need to change your code actually look at the data, for example:

$oldstores = get-content "C:\powercli\OldDatastore.txt".

foreach ($path in $currentdatastores.split (";"))) {

If (-not ($oldstores - contains $path)) {}

...

}

}

Tags: VMware

Similar Questions

  • Automatic creation of pools (linked Clone) using powerCLI

    Hello

    I am using powerCLI to create automatic pool (linked clone). I came across the following cmdlet in theVMware powershell integration white paper:

    Get-ViewVC - serverName < IP/domain FULL name >. Add-AutomaticLinkedClonePool-pool_id

    TestAutomaticLinkedClonePool - namePrefix pad - parentVMPath / < Center > < parentVM > /vm/

    -parentSnapshotPath / < cliché - > vmFolderPath / < Center > /vm - resourcePoolPath

    / /host/ < Center > < ESX > / resources - dataStoreSpecs / < Center > /host/ < ESX > / < datastore >

    -composer_ad_id < id ad composer >

    Now, I want to help discover (with an example will be very useful) how you specify and how find you each of the following (as what do I put after each other):

    -parentVMPath

    -parentSnapshotPath

    -vmFolderPath

    -resourcePoolPath

    -dataStoreSpecs

    -composer_ad_id

    Please give an example of each if possible.

    Thank you!

    OK, I'll give it a try.

    The parentVMPath parameter expects the path to the virtual machine that you want to spawn the pool (obviously).

    Such a path looks like this: / MyDC/vm/MyVM

    Where MyDC is the datacentername, the vm folder is hidden folder that contains the hierarchy of models and virtual computers, and finally the name of the virtual machine itself.

    If your master VM is deeper in the structure of folders, just add the folders in the path.

    Ex: / MyDC/vm/Folder1/Folder2/MyVM

    The parentSnapshotPath is similar to the previous setting, but obviously needs to point to the snapshot pool should clone.

    Alan has a nice feature to recover the snapshotpath Updateand re-view pools calm.

    The vmFolderPath is where the virtual machines that are created for the pool to be stored.

    Similar to the previous settings, but now for the record once again.

    Ex: / MyDC/vm/PoolFolder

    resourcePoolPath must point to a resourcepool.

    Such a path will look something like this: / MyDC/host/MyCluster/Resources/MyResourcePool

    Note that host and resources are again hidden folders!

    datastoreSpecs: this is not the most obvious.

    He wants the full path to a data store in a cluster that is specified by a resource pool.

    See the function VVGetDatastorePath to determine the paths to vSphere Datastore objects

    The composer_ad_id wants that the ID of the AD domain, in which the composer is a member server.

    You can get this through to: ComposerDomain-Get | select composer_ad_id


    As side note, take a look at the Integration of PowerShell with view 5.0 white paper. Perhaps, it is not intended for the latest version of the view

    but he explains some settings a lot better than I could

  • When can I know the delivery date for my Nike Apple Watch?

    IM just curious to know when I should know about the ship date for the new Nike Apple Watch. I just keep seeing end October for shipping. I'm just excited and cannot wait any longer to find out when I get there...

    Hello

    You will receive a shipment notification when your order has been shipped, and to access the tracking information.

    I'm afraid that no one here can tell you when it will be.

    It is a community of support based on the user.

    In the meantime, you can monitor your order status and date of delivery here:

    https://Secure1.store.Apple.com/order/list

  • Cannot delete items in documents and data for each application

    I want to delete unnecessary files in several applications under general > use storage and iCloud > manage storage, but the section documents and data for the respective applications will not operate.

    I have it several times but it doesn't work.

    Can someone help me?

    Thanks in advance

    Omari says:

    I want to delete unnecessary files in several applications under general > use storage and iCloud > manage storage, but the section documents and data for the respective applications will not operate.

    I have it several times but it doesn't work.

    Explain what you do and what happens when you try to delete the data.

  • A Web site can store data for offline use without asking?

    In options, advanced, network, web content offline and the user data, I 'tell me when a website asks to store data for use in offline mode"checked

    And then in the box below that lists Web sites that are allowed to store data for offline use there is an entry "https://forecast.io".

    This site never asked me to store data offline, and I never did anything to him. The website showed there before, I removed it and now it's back.

    So, since I have the box checked to tell me when a site asks you, means that there is not just ask?

    Yes, a Web site can store data for offline use without asking and can do even if you have checked the option 'tell me when a website asks to store data for use in offline mode', because this option does not work correctly. See the bug: https://bugzilla.mozilla.org/show_bug.cgi?id=959985

    As far as I know, it does not mean that the site simply "did not", it's just that the option does not work (or maybe only works in the case where the data are larger than the pref in offline mode - apps.quota.warn?)

    The workaround given by cor - el above, must currently off - apps.allow_by_default set to false.

  • Given to replace my current iphone with a 6s - a trip that I can disable the use of boxes and use a unique sim card data for emails

    Given to replace my iphone today with a 6s - a trip that I can disable the use of boxes and use a sim card only data for email & web.

    If you go to settings > Mobile and less ' use of mobile data for: "turn off all except Safari and Mail

  • How do I remove the launch date for the safe in FF portable ESR 31

    How do I remove the launch date for the safe in FF portable ESR 31. Is it possible that - by pressing the SHIFT key when you launch firefox shows the option of safe mode - off and close the browser.

    See also:

  • How to get back my data for the health and the watch Apps once I've restored my phone?

    How to get back my data for the health and the watch Apps once I've restored my phone?

    From the backup, you're going to be restoration.

    If you back up to iTunes, make sure that it is an encrypted backup.

  • How to use mobile data for large app download data

    How to use mobile data for large app download data

    How can I set big data

  • Could re: Anyone tell me the release date for the Toshiba Tecra S10-106

    Could someone tell me the release date for the Toshiba Tecra S10-106. What would be the estimated price for this model.

    Thank you

    I already posted this in your other thread on Tecra A10.

    On the Europe of Toshiba page-> Products->-> Tecra laptops, you will find a whole list of different series and Tecra models.

    Right now I find only the info that these phones will be available soon.

    You may need to wait a bit...

  • Release date for F30 - 123?

    Sorry if this question has already been asked - I was in a hurry and he couldn't look through the answers I got from my research.
    Does anyone know the release date for the Qosmio F30 - 123, and if it's barely wait rather than buy the F30-111 right now?
    Thank you

    Michael

    Hello

    The Qosmio F30-123 is a very new unit.
    I googled around and found a few sites of Toshiba Netherland with this product.
    It is possible that this laptop you can buy only in Belgium; Luxembourg and the Netherlands.
    F30-123 has a processor T2500 2.0GHz and F30-111 processor T2400 1.83 GHz
    All the features of another should be the same.

    I would recommend to google a bit and I am sure that you will find offers really good.

  • Re: Release Date for the Tecra A10 - 18 p and A10 - 15 c

    Could someone tell me the release date for the Toshiba Tecra A10 - 18 p and A10 - 15 ° C. What would be the estimated price for these two models.

    Thank you

    I didn't find the release date of this laptop models.
    On the Europe of Toshiba page-> Products->-> Tecra laptops, you will find a whole list of different series and Tecra models.
    Right now I find only the info that these laptops will be available soon.

  • Satellite L300: How to use a partition of data for my documents

    Hello

    the Sat L300 160 GB hard drive is partitioned into vista and data.
    I want to save a large number of photos in my documents, which is on the part of vista.
    This example uses only half of the road.

    How to use the data for my documents component? TIA

    Hello

    You can make a folder on the second partition, and can store the necessary files (documents, photos) in specific files.

    Or maybe you want to decrease the Vista partition?

  • I can get the data of a hygrometer using the RS232 port with the following T75.2F:H17.0% using a RS232 data logger format. I was wondering if I can collect this data for later analysis using Dasylab. Any help is appreciated.

    I can collect data from a hygrometer in a text file using the RS232 port with the following T75.2F:H17.0% format, these data are collected using a data logger software. I was wondering if I can collect this data for later analysis using Dasylab. Any help is appreciated.

    The setting below causes the error. Change for the second selection, output values of all channels.

  • Input data for digital indicator tab does not exist

    Hello

    I'm trying to define the range of data for the numerical indicators on LabVIEW 10.0.1. For some reason when I go into the properties of my digital indicator, there is no input data tab as explained on the Web site of NOR: http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/changing_data_ranges_of_nu/. In addition, in the tab data type, there is a section for the range, but everything is gray. Any help is appreciated. Thank you

    Dig up a very, very old manual (1996!) isn't all that productive. If you want to restrict the output, just use the function in the range and force.

Maybe you are looking for

  • After upgrade the iOS 10, HotSpot does not work

    Can't wait to post that iOS 10 update, I could not access the personal hotspot option. I was previously using iOS 9.3.5 and hotspot worked as usual, appearing as an option under cellular. I had used it to connect my other phones to the internet and t

  • DeskJet F2430: Deskjet F2430 fire attention of light, do not print

    DeskJet F2430 will not print. I try and print, it will take the sheet of paper (just plain white paper) to halfway through, stops and flashes the attention. If I close the power button then turn it back on paper will end in scrolls of power, but the

  • Can not get printer hp psc 750 to work with a new Dell dimension 8300

    Original title: the printer does not work I have a new Dell dimension 8300.  My printer is a former hp psc 750 printer scanner copier I can't print.  Can anyone help?

  • Windows Update is running for hours - svchost.exe max' are CPU

    I have a Win7 Ultimate x 64 on a Dell Latitude E6400 laptop computer. Recently, I'm getting is more of new updates. Much more control of updates process continues for several hours (4 +). Since then, I have: stopped the service update windows and ren

  • Difference between packages uc520

    Know you the differences between the "Early Adopter" Version which are available on myciscocommuniuty and the full software pack available on the cisco site? For example:UC520 - 7.1.0 - ea.zip ==> Complete Pack of early adopteur software with all com