Clone a model in a specific folder on the data, with powercli store?

I'm deploying approximately 135 VM from an unique model using powercli from a CSV file.

Each line in the CSV file has a connection, course section instructor

For example...

Login Section instructor

123456 5555 Foo EE123

Here is the script

SE connect-VIServer-Server 10.0.0.60 - Credential (Get-Credential)
$Users = import-Csv c:\CSV\Data.csv
{foreach ($User in $Users)
$Login = $User.Login
$Course = $User.Course
$Section = $User.Section
$Instructor = $User.Instructor
$ResPool = $User.Section + "" + $User.Instructor
New-VM - VMHost 10.0.0.10 - name $Login - ResourcePool "$ResPool" - model 'VM-model' - data store "datastore1".
write "$Login Created" | Out-file "log.txt" - append
}
Disconnect-VIServer-Server 10.0.0.60 - confirm: $false

I'm doing the data store a little cleaner when I deploy these machines and put all the machines in a folder located in the data store, for example. datastore1\spring2013\EE123\ (in reality would have $Course instead of EE123)

Can someone help me with this.


Thanks in advance

Yes, you can use the ResourcePool parameter on the New - VM cmdlet to do this.

But since you have resourcepools with the same name in the tree, you must be sure to only select the right pair.

You use the location setting to indicate which branch of the tree you want.

For example:

$rpRoot = get-ResourcePoo-name 'Sprint 2013"

$rpCourse = get-ResourcePoo-name 'Foo 5555"- location $rpRoot

$rpServers = get-ResourcePoo-name "servers" - location $rpCourse

$rpStudents = get-ResourcePoo-name 'students' - location $rpCourse

New-VM-name--ResourcePool $rpStudents

You can create this logic in a loop and use the name of a CSV file example

Tags: VMware

Similar Questions

  • Get the exact name of the folder on the data of a model store

    All,

    So pretty much miss me it there only a few items.  I want to specify a specific data store and get the names of models and their folder on the data store locations.

    I have this command and it gives me the info of the HD, but is not correlated with the virtual computer name.  Question: How can I format this to get VM name mapped to the location of the data store?

    Get-data center-name 'main data center 1 | Get-data store 'templates_isos ' | Get-model | Get-hard drive

    That is, look at the Parent property

    Get-data center-name 'main data center 1 | Get-data store 'templates_isos ' | Get-model | Get-hard drive | Select Name, Parent

    In the default view you see not all the preoperties that are there.

    You can use the Get-Member cmdlet to see the available properties

    Get-data center-name 'main data center 1 | Get-data store 'templates_isos ' | Get-model | Get-hard drive | Get-Member

  • My user folder displays the data of 30 GB. Actual data are only 2 GB. I want to wipe my drive C of hidden data. How can I get the details of 30 GB of data shown in the properties of the folder

    My user folder displays the data of 30 GB. Actual data are only 2 GB. I want to wipe my drive C of hidden data. How can I get the details of 30 GB of data shown in the properties of the folder.

    Hello

    This free program allows you to see what is taking place.

    http://www.Jam-software.com/treesize_free/

    Here's how to understand Treesize Screenshots:

    http://www.Jam-software.com/treesize_free/screenshots.shtml

    ____________________________________

    Also check how much space system restore uses:

    http://Windows.Microsoft.com/en-us/Windows7/how-much-disk-space-does-System-Restore-require

    _____________________________________

    You can clean your hard drive using these two methods.

    "Delete files using Disk Cleanup"

    http://Windows.Microsoft.com/en-us/Windows/delete-files-using-disk-cleanup#delete-files-using-disk-cleanup=Windows-7

    Using the free CCleaner program:

    http://www.Piriform.com/CCleaner

    In NO case use the registry cleaning Option in CCleaner

    _____________________________________

    Download, install, update and scan your system with the free version of Malwarebytes AntiMalware:

    http://www.Malwarebytes.org/products/malwarebytes_free

    And Norton Backup, if you are using Norton, can do strange things with filling of hard drive space.

    See you soon.

  • Restrict access of a user AD to a specific folder on the network

    I have a Windows 2008 R2 and Windows 7 users.

    I have a group in my ad called "Finance".

    I have a folder on the server C:\fileserver\department\finance\

    All users in the group above are mapped to the C:\fileserver\department\finance\

    In the C:\fileserver\department\finance\ folder there is a folder called payroll.

    A new employee (finance) started working today.  I created his profile in AD under the Finance group.  But his boss told me that it cannot access the pay record (a little).

    Where can I go and block access to this new user to access the payroll folder? I have no idea.

    Thank you very much

    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 to synchronize the folder on the PC with folder on a flash drive.

    I would like to be able to synchronize a folder on my USB key with a folder on my PC. Is it possible to do? Basically, I'd love to plug my USB key, right click on a folder and synchronize it with my PC.

    Thank you

    Like Steve, I use the second copy. I also use SyncToy or Rich Copy depending on the situation. You can also check the Win 7 Sync Center facilities. All of these solutions offer simple point and click ease you want, but are worth a glance, I think.

    http://TechNet.Microsoft.com/en-us/magazine/2009.04.UtilitySpotlight.aspx?PR=blog
    Center of control Panel\All Control Panel Items\Sync

    Tom

  • Datastore shared ISO? (or the shared folder in the data store)

    I just added a second machine running ESXi 5.0. I have a data store on a test with a data store that I would like to access from the new machine #2.

    Essentially machine #1 has a store of data with a folder called "ISO" and I would like to access from machine #2. I am running FreeNAS so I'm comfortable with a shared NAS, but it would be something different - I want to be able to have the machine use/mount #2, ISOs of the ISO datastore machine #1 so that I can build VMs on machine #2.

    Hope that makes sense - have spent a lot of time on Google looking for this and it is not easy to find.

    Thanks for the replies.

    Hello

    Yes, that clears my question.

    And my answer is no, you can't.

    It is not possible to share a local storage to other esx hosts.

    We must build a shared your NAS storage. It s possible to use a VM´s as a NAS for sharing your space for storage, but you need storage shared for your needs.

    It is possible to build a shared your free NAS iSCSI storage (I think). You must configure your storage software host esx iscsi adapter to connect to the shared storage.

    See:

    http://communities.VMware.com/message/1467270

    http://www.sysprobs.com/connect-FreeNAS-iSCSI-disks-VMware-vSphere-4-esxi4

    Frank

  • script to create the folder on the data store please

    Hi all!

    I'm having difficulties writing a powercli script to create a file on a data store... we have a mixture of guests ESX 3.5, 4.0 and 4.1, using data storage mounted via NFS.

    For work I do, I need to:

    (1) create a folder on a data store (check that the folder does not already exist).

    2) navigate to the folder

    (3) and check if a particular file exists in this folder.

    The problem is that the context of my current position makes the code does not. the get-location method returns "C:\temp\ESX", being the record that I run the test script to. I try to use set-card with various settings to try to change the location of a particular data store, but it does not yet work-get-location returns "C:\temp\ESX".

    I think that the code for step 3) above is ok, but I can't get any code to work for) 1 and 2).

    can someone please?

    Thank you

    Ross.

    You must use the vimdatastore provider to access your data warehouses.

    It is documented in vSphere PowerCLI Administration Guide, which is installed on the PC where you installled PowerCLI.

    You can use the 'normal' cmdlets to navigate, test and create folders.

    For example:

    CD vmstore:

    LS # will show the upper level

    CD MyDatastore\MyFolder # navigate with the alias "cd".

    test-path MonAutreDossier # check the existence of a folder or file

    mkdir test # create a folder

    I hope this helps

  • Clone/convert model... not available in the menu?

    Hello

    We have 2 floating licenses of VMWare ESX 3.5 and run 2 R3 servers which we VI-client access.

    I would like to create a template from a virtual of Win2003 machine I just created.

    as described in http://searchvmware.TechTarget.com/Tip/0, 289483, sid179_gci1320419, 00.html

    Unfortunately I don't see not all models entries in the menu.

    I miss some components or should I spend a few options?

    Best regards

    A. Farber

    You need Virtual Center for this.

  • Cannot open a specific folder of the Preview of my office

    I have many files of office that does not open all open them with a double click except one. What should I do?

    What happens when you double-click it? Can you control - click and open it?

  • image folder of the file with question mark flashing on the screen

    I just bought a 2 month old 15 "macbook pro to an individual. I turned it on this morning and there is a picture of a small folder with a question mark in the Center, flashing on and outside. does anyone have a solution for this?

    Hi Hotrod45:

    Was this before start or is this the first time you the active since buying it?

    Check out this technical note. If flashing question mark appears when you start your Mac - Apple Support

    Kim

  • HP pavilion model dv9910us: unable to connect to the internet with hp laptop using xfinity router/modem

    Hello

    I have a hp pavilion computer model with windows vista premium OS hom dv9910us.  I have a wireless modem/router xfinity gateway device.  I got it somewhere else and it worked using verizon with a router and a separate modem.  I also tried a location xfinity with a router and a separate modem and it worked.  I had a separate wireless adapter and installed and disabled the atheros ar5007 adapter in Device Manager.  This 2011 atheros adapter will work with this model computer using the operating system windows vista Home premium.  If so, could I leave the disabled ar5007 and install the 2011 to make sure it's ok before you uninstall the ar5007.  I'm really a novice and stumbling just my way through it.  Any help is appreciated.

    Hello:

    You must enable the atheros wireless card and install this driver.  It has no effect on the other you use.

    http://h20564.www2.HP.com/hpsc/SWD/public/Detail?sp4ts.OID=5060881&swItemId=ob_108905_1&swEnvOid=4059#.

    Then turn the PC off, remove the usb adapter, reboot and see if you can connect via the atheros card.

  • get the model in qml elements and display the data?

    Notecard:

    {

    for (varx = model. first () ; x! = model. last () ; x = model. after (x))

    {

    var point = model. data (x)

    Console. Journal (item.getID)

    }

    }

    I try to get the QString for this point object, but I can't to do anyone know how I can get the item of property values?

    No I figured that out I made a mistake with the properties,

    Q_PROPERTY (QString ID READ getID WRITING setID);

    Reading and writing are functions which the qml engine uses to communicate with c ++ and act as a wrapper for the property ID.

    and ownership m_ID of c ++ is independent of Qml, so I just replace it with ID instead of getID and it works

  • How you can display the details-the folder name, the date, labels, size, type when displaying folders as large icons?

    Windows 7
    How you can view the records/document details-name, date, tags, size, good guy that watching a records/documents too large, medium or small icons?
    I have to be able to sort the records/documents while in the large, medium or small icon view I have in Vista. I can't settle unless I'm in the Details view. I work with graphics mostly, so I need to see while I sort.

    Even if the headers are not visible, you can sort/filter/group by those details by right-clicking on an empty spot in the folder and choose the fate/group that made a right click menu.

    Your preference of sort/group will remember your next visit this folder.  For more information on how to apply your preferences of sorting/grouping of all records at once, try my tip at http://skeene.net/tech/apply-folder-styles-to-all-subfolders/
  • Shared folder for the data flow

    We connect our FMS3 with our SAN with shared folders, the path to the shared folder is '\\.host\Shared Folders\SAN1\ '. And we have tried to make this shared folder as 'z': disk, then modified Application.xml as "< streams > /;" "Z:\vod < / stream >", but the flow still would not play with the error "ConnectionError". We also tried to modify Vhost.xml, still no luck.

    We configure the authorization of SAN for FMS read only, do we need to change it to read and write?

    I'm recognizing all possible solutions. Thank you.

    Problem solved by reading this post:

    http://www.Adobe.com/cfusion/webforums/Forum/MessageView.cfm?CATID=578&ThreadId=1220842&me ssid = 4394726

    Thank you.

  • PC Refresh has not left a folder on the desktop with programs that have been deleted

    I just did an update last night (laptop was very slow) and there is no list on my desk that shows which programs have been removed.  If this is on the C drive anywhere?  I don't mind writing what I had installed because the directions said that the record would be on my desk.  Help!

    Hello

    Thank you for the update.

    Unfortunately, there is no other place removed programs may be listed. If you use the same Microsoft Account, you can visit the app Store and bought to see all applications installed via the store.

Maybe you are looking for