Need to reconfigure the VM after vm deployment

Hi All,
I am having a script to deploy a VM from an CSV file . I need to change the vm ( CPU & Memory)  configuration after vm deployment. where the name of the vm should be taken from csv.So any help is much appreciated.
Attaching the script used . ( downloaded and works fine)
$vms = Import-CSV D:\vm-deploy\vm-deploy.csv
foreach ($vm in $vms){
      $Template = Get-Template $vm.template
      $VMHost = Get-VMHost $vm.host
      $Datastore = Get-Datastore $vm.datastore
      $OSCustomization = Get-OSCustomizationSpec $vm.customization
      New-VM -Name $vm.name -OSCustomizationSpec $OSCustomization -Template $Template -VMHost $VMHost -Datastore $Datastore -RunAsync
## This cmd need to execute after the vm deployment completed. The VM name should come from the 1 colum of CSV file
Set-VM $vmname -NumCpu 2 -MemoryGB 5 -Confirm:$false
Write-Host "All vms deployed, " -ForegroundColor Green
Disconnect-VIServer -Confirm:$false
CSV file looks like this
Name,Template,host,datastore,customization
Test-VM,vm-dep-test,ESX02,P5-vm-stage,vm-deploy
Thanks in advance.....

A simpler, but not optimal, solution is to use the Wait-Task cmdlet.
Something like this
$vms = Import-CSV D:\vm-deploy\vm-deploy.csv
$tasks = @()
foreach ($vm in $vms){
      $Template = Get-Template $vm.template
      $VMHost = Get-VMHost $vm.host
      $Datastore = Get-Datastore $vm.datastore
      $OSCustomization = Get-OSCustomizationSpec $vm.customization
      $tasks += New-VM -Name $vm.name -OSCustomizationSpec $OSCustomization -Template $Template -VMHost $VMHost `
          -Datastore $Datastore -RunAsync
Wait-Task -Task $tasks
foreach($vm in $vms){
  Set-VM $vm.name -NumCpu 2 -MemoryGB 5 -Confirm:$false

Similar Messages

  • Need to reopen the form after saving

    Hi All,
    I am developing a form for employee time sheet. I am using the ON-INSERT Trigger to insert the details of the employee. I need to reopen the form after inserting the details into table. I tried using the NEW_FORM bulit-in in POST-INSERT Trigger. but getting an error: FRM-40737 illegal restricted procedure NEW_FORM in POST_INSERT) Trigger. Can any one please how can I do this.
    Thanks and Regards
    Sai

    Hi Jeneesh,
    Thanks for the reply.
    I need to clear the form after saving and also I made the Update Allowed property to 'NO' as client per requirement. So, every time after saving the form, I am getting an error message 'Update is not allowed on this form' . in order to avoid this message after saving I want to close this form and open it again.
    Also I need to clear the datablock. where can I clear the datablock after saving it.
    Thanks
    Sai.

  • Am I need to Eliminate the object after used??

    Am I need to Eliminate the object after used to release the resource ? Which like C code: free(Dynamic variable). And why and how they works in java??
    Thank alot !!!

    You may want to read about garbage collection in java. Basic intro in [url http://java.sun.com/docs/books/tutorial/java/data/garbagecollection.html]tutorial, after that search around the site for garbage collection and related topics
    Mike

  • Do i need to reconfigure my cRIO after updating into 8.5

    Hi all,
    I used to run my program with 8.2 LabView software . Now i m updating into 8.5 version .
    Do i need to change anything or reconfigure my cRIO controller ?
    Thank you
    Best regards ,
    roxy

    Hi Roxylat,
    For just a LabView upgrade, you do not need to reconfigure your cRIO. However, for future information, you do need to reconfigure the cRIO in any of the following circumstances:
    1. You change the versions of either NI-RIO, NI-VISA or Real Time.
    2. The NI-RIO versions on your controller and your PC are not the same.
    Hope this helps.
    Ipshita C.
    National Instruments
    Applications Engineer

  • Can't restore apple id ,you were blocked for security reasons, but to restore the need to enter the key after typing it sends a 4-digit code on the ipad , but at ipade I am not connected to icloud ,and to connect you need to recover your account

    can't restore apple id , because apple were blocked for security reasons, but to restore the need to enter the key two- step werification . after typing it , apple sends a 4-digit code on the ipad , but at ipad I am not connected to icloud ,so i cant get code . but if i want to recover apple id, i need to  connect icloud, so what to do? help !

    I have (sorry forgot to add that). I was switched around and finally I was told I would be put through to a supervisor but after being on hold for about 10 minutes the phone went dead, I did not lose connection so I do not know if I was hung up on or there was some technical difficulty. I called again yesterday and did in fact speak with a supervisor for Account Security but he told me he did not know why it was happening and put me through to a different number but that ended up not being any helpful either. That's when I decided to give it a shot on here!

  • I need to get the tagName after a node of the first child of the Root

    Hi All,
    I need to get the TagName of the Node immediete after the Root. I won't know what is the TagName, and based on the Tagname only I can process the records.
    For example I might receive a SALES object or a MARKETING object wrapped under the root.
    eg.
    <PARENT>
    <SALES>
    </SALES>
    </PARENT>
    or
    <PARENT>
    <MARKETING>
    </MARKETING>
    </PARENT>
    I tried to using like this
                   DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
                   File file = new File("c:/example.xml");
                   document = documentBuilder.parse(file);
                   Node node = document.getDocumentElement().getFirstChild();
                   System.out.println("node Name:" +node.getNodeName());
                   System.out.println("node Value:" +node.getNodeValue());
    It returns only something like #text, but I need the response like 'SALES'.
    Can anyone let me know if im missing something somewhere.
    thanks in advance,
    Harish

    That's because the first child of the document element is that whitespace text node between <PARENT> and <SALES>. You need to scan through the children of the document element until you find one that is an Element node.

  • Do I need to keep the .dmg after installing an application ?

    I drag the dmg to the application folder and do the install, do I need to keep the .dmg afterward? as i`m doubling up on files and filesize,

    No, unless you're running the application straight off the dmg.
    (75180)

  • EAR file not reflecting the changes after successful deployment

    Hi Everyone,
    We have a weird situation where we deployed a EAR file in NWDS and changes got reflected in Dev portal and when pushed to QA the changes are not getting reflected.
    There must be some archieving issue or unable to overwrite the existing EAR file...
    Please help us out this is happening only for one ear file rest are getting deployed properly.. we are using sd

    Hi,
    There are possibilities that your ear is depending on other referenced application/class. I encounterred like this kind of error. In my situation the dependent/referred project/classes were not deployed correctly.(Correct version is not deployed).
    My suggesstion would be in that area,so check if all the used components latest version is deployed.

  • Need year on the top after Offsetting

    Hi ,
    My requirement requires me to show Actual cost incurred in a project for current year and the year before.I have used fiscal year in the columns and have used it to offset by -1.The report displays the selected year on the top of column 1 but does not show 'year-1' on the top of other column.although it shows the correct data.any help will be appreciated

    I dont see any apparent reason why the text for the 2nd variable is not displayed, when the first column header with the current year is displayed.
    Check ur text variable and the way it has been declared in the column heading.
    BTW - ur subject is very misleading and no connection to ur issue, a better subject would have been better

  • Reconfigure the Oracle streams incase of Server move from 192 to 191

    Hi All,
    We have bi directioanl oracle streams setup between two databases.
    Recently, We have moved our server from cin192 to cin191. After server moved we checked the all the streams process.
    Capture process shows Wating for Dictionary Redo First SCN XXXXXXXXX on both the database.
    When i checked these SCN ,i got cin192 archive log.
    Can you please help how can i resolve these issue..
    Do we need to reconfigure the streams or we can assign new SCN to capture process without dropping anything with cin191 server archive log file...
    Means , How to point new server archive log file to capture process..
    Any help would be appreciated...
    It's urgent...Plzzzzzzzzzz Help.
    Thanks,
    Singh

    Hi Singh,
    If I would know what cin191 and cin192 are, I would probably be able to redirect you to the right forum.
    If you are looking for Oracle streams, I suggest you to try the Database - General forum: General Database Discussions
    If is Oracle replication what you are looking for, please check here: Replication
    This is the Berkeley DB High Availability forum ( http://www.oracle.com/technology/documentation/berkeley-db/db/ref/rep/intro.html )
    Bogdan

  • I have installed iOS7 on my iPhone4. I am able to add/edit contacts by clicking the "contact" icon. But when I am trying to do the same after clicking the "phone" icon, it is not displaying the keypad. I believe it is a bug in iOS7. Please confirm. iPhone

    I have installed iOS7 on my iPhone4. I am able to add/edit contacts by clicking the "contact" icon. But when I am trying to do the same after clicking the "phone" icon, it is not displaying the keypad. I believe it is a bug in iOS7.
    Please confirm.
    iPhone 4, iOS 7

    Hello jayanand,
    You may need to force close all open apps, then restart the phone. If necessary, you may need to reset the phone after that.
    iOS: Force an app to close
    http://support.apple.com/kb/HT5137
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430
    Cheers,
    Allen

  • Closing the browser after logout

    Version 1.6
    We're using Internet Explorer and I need to close the browser after/when the user clicks on the Logout link. How can I accomplish this?
    Thanks,
    Joe

    The online help for the onClick Javascript field says
    "In the link generated for this icon include the following onClick javascript.  Use of the onclick javascript could popup a help page in a new window (see example 1).
    Example 1:
      window.open('US/asfhhome.htm','Help','scrollbars=yes,resizable=yes,width=625,height=350,left=25,top=150');return false
    Set the Icon Target attribute to # if you are using OnClick JavaScript. Set the Image Alt Text attribute to the text the user will see to click on."So, try putting "#" in the Target and window.close() in the onClick Javascript box.
    Message was edited by:
    Vikas

  • I need to upgrade the silverlight version that is deployed with the SCCM 2012 client installation

    We have SCCM 2012 SP1 installed and I need to upgrade the version of silverlight that get installed on the client deployement.
    The version that is automaticly deployed is 5.1.10411.0 and this one is not compatible with Firefox.  When you click on Application Catalog it start the browser but it fails to load because of the silverlight plug-in that is not up to date.  The
    version that is working fine is the 5.1.20913.0 and it's already installed on my SCCM site server.
    So that is why I'm looking to upgrade the silverlight that is installed with the SCCM client.
    I know that a simple workarround would be to create a package that would be deployed after the client gets installed, but why not changing the original package at the source instead of installing twice the same software the get the right version!
    Is there someone that could point me where I could upgrade this Silverlight prerequirement software version ?

    Note that I have not tested either of these and they will not be supported by Microsoft. 
    1. Copy your new version of Silverlight.exe to C:\Program Files\Microsoft Configuration Manager\Client\i386
    (you'll have to re-distribute the client package after this).
    OR
    2. You could edit the ccmsetup.xml file with an alternative location for silverlight.exe
    </Item>
     <Item FileName="i386/Silverlight.exe" FileHash="417B442E128D821119008ACEEEE6CDC2A41224377A829B6EC52BABA2724F0151">
      <Applicability Platform="ALL" OS="ALL">
       <Skip>Embedded</Skip>
      </Applicability>
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

  • After installing OS X Yosemite 10.10.2 -  I get this when I try to open Illustrator " To open "Adobe Illustrator CS6" you need to install the legacy SE6 runtime." I can not get seem to do this, how is this done?

    After installing OS X Yosemite 10.10.2 -  I get this when I try to open Illustrator “ To open “Adobe Illustrator CS6” you need to install the legacy SE6 runtime.” I can not get seem to do this, how is this done?

    Robert,
    It seems to be enough to create empty folders at “/System/Library/Java/JavaVirtualMachines/1.6.0.jdk” and “/System/Library/Java/Support/Deploy.bundle”, to make Illustrator use Jave SE 8 as it should.
    This way to get round the legacy JAVA requirement was presented by Kals in post #7 in this thread:
    https://forums.adobe.com/thread/1637908

  • What will be the peoplesoft query to calculate voluntary termination count and involuntary termination count? I am working on OBIA HR analytics workforce deployment reports and need to validate the reports

    what will be the peoplesoft query to calculate voluntary termination count and involuntary termination count? I am working on OBIA HR analytics workforce deployment reports and need to validate the reports. I also want to know the tables involved

    Hi Andrew,
    Part A:
    I've done some restating of the question, and distributed the calculations among several fields, not all of which need to be included on the visible layout. Other than formatting the Date fields and moving the 'Completed Date' field and its label, I've left this in the default "Layout 1" produced by AppleWorks.
    Field List:
    Priority: Popup menu with six items: 00, J, D, 1, 2, 3  Defaults to 00
    TL (time limit in months): Calculation:  CHOOSE('Priority',0,1,3,4,6,12)
    Received: Date. Option: Automatically insert today's date (ie. Date Record created) (may be edited)
    Target Date: Calculation:
    DATE(YEAR('Received')+INT(MONTH('Received')+'TL')/12,MOD(MONTH('Received')+'TL', 12),DAY('Received'))
    Remaining (Days): Calculation: INT('Target Date'+1-NOW())  (see revision below)
    Completed: Checkbox. Set default value to Unchecked.
    Completed Date: Date: Entered manually
    OnTarget: Calculation: IF('Completed',IF('Completed Date'<'Target Date',"On Target","Over"),IF(INT(NOW())>'Target Date',"Over","On Target"))
    The On Target field shows the current status of the case while still open, and the state on the closing date when it was closed.
    Having done that, I was unhappy with the Remaining field continuing to calculate an ever larger negative number after the case had been closed. Hence this revision below:
    Remaining: Calculation: IF('Completed','Target Date'-'Completed Date',INT('Target Date'+1-NOW()))
    Shows the number of days remaining while the case is open, the days remaining at completion if the case has been marked Completed and the completion date entered.
    Rsults (and some further formatting of the Layout) below.
    Part B:
    You will need Subsummary parts when sorted on Completed and on On Target. Fields can appear on  a Layout only once, so each subsummary part will need a separate Summary type field for each field to be summarized.
    Regards,
    Barry

Maybe you are looking for

  • Sending multiple email for free goods item category??

    Hi, we have requirement to send email (Z report in smartforms) automatically when sale order save in tcode VA01/VA02. we made reqd config in tcode NACE and we set access sequence on ORDER TYPE and it's working fine. but the problem is that when order

  • Error While Saving As PDF

    Hello, We are on HFM 11.1.2.1.103 and financial reports 11.1.2.1.00 and I am having an issue when running a report batch. I have a batch that I run each month which contains a few reports which are emailed out to users. For some reason, the second ti

  • "Calculate Average" option for the Activity Usage Profile doesn't work

    I have the same problem as poster 793128 in a comment for a different thread: the "calculate average" profile option doesn't work for units (it works for cost though). I've used this option a lot on previous versions of Primavera but for some reason

  • Error 62 in Event Viewer

    Hi all Could you shoe me about an error 62 that i saw in Event Viewer when i send email in SAP B1 Thank you!

  • Getting objeects ddl in Oracle 8i

    Hi , i believed there's no dbms_metadata package in 8i but how can i get the objects' ddl besides the export/import utility ? tks & rgds