need to reconfigure the virtual computer after deployment of the vm

Hi all

I have a script to deploy a computer virtual to a CSV file. I need to change the configuration of virtual machine (CPU and memory) after the deployment of the vm. where the name of the virtual machine should be taken to csv. So any help is appreciated.

Attach the script used. (downloaded and works fine)

$vms = import-CSV D:\vm-deploy\vm-deploy.csv

{foreach ($vm to $vms)

$Template = get-model $vm.template

$VMHost = get-VMHost $vm.host

$Datastore = get-data store $vm.datastore

$OSCustomization = get-OSCustomizationSpec $vm.customization

New-VM-name $vm.name - OSCustomizationSpec $OSCustomization - VMHost - $VMHost model $Template - $Datastore - Datastore RunAsync

}

# This cmd need to run after the vm deployment completed. The virtual computer name must come from the 1 column of the 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, host datastore, Template, customizing

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-job cmdlet.

Something like that

$vms = import-CSV D:\vm-deploy\vm-deploy.csv

$tasks = @)

{foreach ($vm to $vms)

$Template = get-model $vm.template

$VMHost = get-VMHost $vm.host

$Datastore = get-data store $vm.datastore

$OSCustomization = get-OSCustomizationSpec $vm.customization

$tasks += new-VM-name $vm.name - OSCustomizationSpec $OSCustomization - model $Template - VMHost $VMHost '

Data - $Datastore - RunAsync store

}

Waiting-task-task $tasks

{foreach ($vm to $vms)

$vm.name set-VM - NumCpu 2 - MemoryGB 5 - confirm: $false

}

Tags: VMware

Similar Questions

  • I need to reconfigure the network wireless repeated now

    I need to reconfigure the network wireless repeated now.  Internet connection drops and I re - check the box 'use windows to configure wireless network. "  Why this keep happening?

    Provide more information, including the version and service pack of Windows, the brand and model of your computer and the make and model of your wireless adapter.

    In the meantime, however, your description sounds as if you have a utility provided by the manufacturer of your computer by the manufacturer of your wireless card which is competing with Windows for control of your adapter.  You must choose one or the other; You can't have both at the same time.  For a general introduction to the present, see http://www.ezlan.net/wzc.html

  • No network connection to the virtual computer after migration manually to the new host

    We have added six new hosts to our environment, and I was tasked to test connections of VIRTUAL LAN on each of them before we move VM production of their.  This is probably a simple problem, but I am new to VMWare and need help.  I already talked to our network guys, and he assures me that the physical switches are setup and working properly.  We work a vDS.

    I'm testing 14 VLANs on six new hosts.  All but one are constantly working.  (They all work on the hosts of origin which were in force before.)  I have a static IP configuration on my test VM and MAC is set to automatic.  I checked the MAC does not change when you migrate to other hosts and the VLAN correct is listed in the settings the VM network (it is not empty).  Him VLAN will work on three of the six hosts, but not all at the same time.  The strange thing is that guests at work are constantly changing.  For example, this morning hosts11, 12 and 14 may work, but this afternoon, that could change at hosts12, 14 and 16.  I don't understand why they would change on their own.

    My test consists of VM testing, migration manually, powering back, then he ping from my computer off.  Of course everything works when I get ping responses.  When I get no answers, the test of the virtual machine has a yellow exclamation mark on the network icon in the system tray.

    What should I do to fix this?

    How is the network configured?  You have a different NIC port/cable for each VLAN or Trunking used on the side of the switch?

    If you use circuits on the side of the switch, then your GRPE ports virtual switch a VLAN ID needs to match the vlan is underway to shared resources.  No matter if it's a standard switch or switch distributed... you still need this ID of vlan.

    I've seen the random question that you encounter if missing one or more of of the uplinks on the side of the switch the VLAN.

  • Can double-click is no longer on a virtual computer after update to Win 8.1 (on the Mac host)

    Hello

    We have VMWare Fusion Version 5.0.3 (1040386) running on a Mac Book Pro (Mountain Lion) with a Windows 8 VM, updated week last through the App Store to 8.1

    We have this problem on all our machines:

    1 open Windows Explorer, navigate to any 'virtual' folder (ie. a folder which is actually pointing to a folder on the Mac, for example My Documents).


    2. you can see everything, but you can't do anything with it. For example, double-click a file to open it and the application (for example, Notepad, Excel, whatever) does not start. The workaround, it is that you have to go to the physical folder on the Mac and open the file, then it will open the appropriate application of the virtual machine (and the file opens in the application). On VM Win8, it wasn't necessary, it has worked well for the virtual machine.

    3. you double-click any subfolder to open it either, you can never see the top level of the virtual machine.

    It seems that the behaviour of 'double click' is broken.

    Any ideas?

    Thank you

    OK, the solution to this problem is not double click, but sharing folders. VMware tools needs to be completely ONE installed, restart the virtual machine, and then reinstall the VMware tools.

    I also had to change the registry settings in Windows for VMWare tools first, because otherwise it could not be uninstalled.

    The steps to edit the registry are in this thread, the Zypher response:

    https://communities.VMware.com/thread/460232

    Changes to the registry, then select Virtual Machine in Fusion, the menu reinstall. This will cause the Tools CD-ROM mounted in the virtual machine (Windows 8.1 in my case). Ignore the guests that appear and instead, open Control Panel and choose to uninstall VMWare Tools. You must restart the virtual machine later. After the reboot, new Virtual Machine in Fusion menu goto and now select "install VMware Tools". You will need to logoff the VM at the end and reconnect again.

  • Reload the Configuration of the virtual computer after changing the VMX file

    Hello

    If I make changes to a file on a virtual machine's .vmx in vCenter 5.5 is automatically valid configuration for the engine power vm off? I made some changes earlier and it seemed to be the case, but one of the steps that I see in some of the documents is to reload the configuration of the vm, so it can be used appropriately. So this happens automatically or not?

    Hello

    If she turned off the virtual computer, then during power on, changes to take effect.

    Concerning

    Mohammed

  • You will need to reconfigure the LAN WLAN settings in the Windows XP machine.

    Original title: LAN WLAN Configuration.

    I just did a cover on my hp nx6110 and I was able to get windows xp up and running again. But when I tried to do my job of Lan or Wlan work again once I was told by my ISP that I need to reconfigure my Lan and Wlan on my laptop. Is it possible that I can get information for this instead of bring my laptop to a professional, because this computer is already 5 years and more under warranty. Or is it available by download on a USB stick and transfer it to my new computer to the hp nx6110?

    Hi JohnJacobi,

    You can follow this link and check if it helps.

    To make a connection to the local network

    Hope the helps of information.

    Please post back and we do know.

  • Recovery of a virtual computer after executing "Reset System Configuration"

    Is it possible to recover Virtual Machines, once you have run the ESXi server reset system configuration?

    I reconfigured the management network and connected sphere, and I can see the space my old VM disk on the server is still there. But how ESXi to see again them?

    JW

    Right-click on the .vmx file in each of it VM directories and select "add to the inventory;

    / Rubeck

  • Unable to start the virtual computer after restoring the backup

    Hello

    I have a very big problem! I have a Machine virtual Windows Server 2003 on a Mac Mini with Mac OS 10.6.8 2009 Sever Server and VMWare Fusion 4.1.1 and I had a record of crash! A backup is performed daily and I take snapshots of security risk.

    I changed the faulty HARD drive and restore "Mac Data. Now I want to restore my data from VM, but after that, I can't throw my VM. I have this error message: "Unable to get information on snapshots, lock down." (French translation, it can differ from original English message).

    I get on the internet and found that you must delete the snapshots and try again, but when I do this, I have this error message: "the VM seems to be used. The same thing when I want to create a new capture instant.

    I'm stuck and I have to solve that before Monday...

    Thanks in advance for the help.

    With the merger closed, open the package of vmwarevm of the VM (CTRL-click) and delete all the files and folders with a .lck extension. These files are used to lock the files logically and very probably contain stale data.

    BTW. do you really need > 20 shots? Too many clichés can slow down the virtual machine significantly.

    André

  • Re-create the virtual computer after the failure of the host

    Hi all

    Yesterday I encounter a questions that I struggle to deal with approprietly:

    Some old 3.5 host crashed and after reboot, one of the virtual machine (ubuntu) has been corrupted or issued in the inventory. Normally remove inventory

    and re - register always help again--this time, after removing the inventory - there is no vm file - only content on screen attached.

    I have searched for solutions, but since I did not compatible vmdk - I do not know what first?

    Prospects for some advice...

    Thanks in advance!

    vmdk.jpg

    I would start by searching other stores of data for the VMX file or in a directory with the same name that the VM - if you don't think I'd attempt to rebuild the virtual machine, but instead of creating a new virtual I slelect use an existing disk and point to the - delta file that is a snapshot.

  • Can not put on the virtual computer after Storage VMotion

    I use the snap for the customer VI do some storage vmotion, where I can best use our space on our tables. I have a particular virtual machine that I transferred autour storage that has a total of 3 VMDK, all on separate LUNS. As soon as I moved them all in the right place, where I wanted them, I can't turn on the virtual machine because it says there is no space available on the device. I am trying to boot the machine with 4 GB of memory, the boot LUN more than 400 GB free on it. The other two LUNS have 225 MB, and 192 MB of free space. I can only start the machine if I change the memory of 192 MB or less. I know that problems with the file exchange and memory overhead, but this virtual machine has always run with these two LUNS with very little space. I can only assume it is somehow related to the storage vmotion. The pagefile is set to store the virtual machine and I'm still having the problem. Need help.

    Storage vmotion the VMX file of the LUN with more space (easier) or add manually a config parameter (settings, Options, general, settings) sched.swap.dir = / vmfs/volumes/DS/Machine

    (where DS and Machine related to your environment).

  • Unable to connect to the console of the virtual computer after dns change

    I finished just change of my VM and VC servers esx hosts to use the new dns servers. In addition the area changed as follows

    from vm1.subdom1.xxx.com to vm1.subdom2.xxx.com the esx hosts and vCenter server all underwent this change at the same time although ip addresses have remained the same.

    In vCenter but I do not see "cannot connect to MKS: address for server vm1subdom1.xxx.com host lookup failed: no host is unknown.»

    If I log into the esx vSphere Client with server can't connect to the console where I can say vCenter to use the new name of the virtual machine instead of the old host? I can ping and resolve the vm from the vCenter server and RDP to DNS so it works but vCenter is still going to the old address.

    Any help?

    To access the Console of the virtual machines... the vCenter does not really rely on the DNS config. It communicates only through ports 902/903

    This problem could have arisen due to some misconfig while changing the DNS... .pls try below

    Remove and re-add the vCenter ESX Server

    Restart the ESX management services... #Service mgmt-vmware restart

    -All the best

  • Can not power up the virtual computer after failure of storage

    An error was received from the ESX host turning on VM myvm. Cannot create the file ' / vmfs/volumes/53309937-d077e300-a76c-0025b51a12ae/myvm/vmx-CDCSA1-805443817-1.vswp ': host no is not a newspaper could not start VMX: msg.vmk.status.VMK_NO_JOURNAL

    Restart the ESX host solved the problems.  Restart all services did not help.  Air data warehouses / ReadOnly.  VMotion would hang up on VM associated with these stores of data so that means a failure, forcing the host to restart.

    -Stephen

  • Running Windows 7 on a virtual computer after upgrade

    I have upgraded to Windows 10, and after the 30 days has discovered that XP mode does not win 10. I know that I can't legally dual-boot my old license of Win7, but can I run under a virtual machine on the same PC?

    I read somewhere that I can run a virtual machine in a virtual machine, so I hope I can use it to launch XP, since getting a support of c/w XP Pro legitimate retail version COA becomes more difficult every day. I can find a seller, but they want more than a Win 10 retail price!

    It would be nice if, as some programs I've used, I could activate an older version with the key to a more recent version.

    Hello

    As you mentioned could also be turned down for XP?

    N °

    Hope this information helps. Please let us know if you need any other help with Windows in the future. We will be happy to help you.

  • I need help restoring my sons computer after accidental compression by car please!

    Hello, I have problems with my son computer I turned it on and it says bootdsk compressed he said he used the cleaning disc and put a check mark in the compress file or box player's there to fix it without losing all its files?

    Hello

    Thanks for posting your query on the Microsoft Community.

    I would like to know some information.

    1. Are you able to start on the computer?

     

    I suggest refer you to the Microsoft Help Article below and check if that helps.

    http://Windows.Microsoft.com/en-us/Windows/repair-recovery-help#repair-recovery-help=Windows-7&V1H=win8tab1

     

    Hope this information helps. Please let us know if you need any other help with Windows in the future. We will be happy to help you.

  • Gets the message to reconfigure the Internet trying to connect to the World of Warcraft account.

    Original title: reconfigure my internet.

    When I connect my computer to my internet at home after connecting it to a different internet in a friends house I get a box indicating that I have to reconfigure my internet connection everytime I try to log in to my world of warcraft account

    Hello

    If the need to reconfigure the internet connection is made only through the game, I recommend you post on the forums of World of Warcraft for assistance.

    Hope the helps of information.

    Concerning
    Joel S
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for

  • Apple account security

    Can someone please tell me if someone else got an email indicating that their Apple account has been suspended My email to apple received a msg. I did not open the link to the msg but clicked on the title This is the sender [email protected]

  • is there a way to activate the Tracking on a regular firefox window protection

    I love the new feature of private monitoring windows protection...I would like to know if there is a way to enable this feature in the ordinary windows(I already have the option 'Request that the sites will not follow you', but I guess it leaves the

  • Add memory to slimline s5212y

    Add memory to slimline s5212y with windows 7 Home Premium 64-bit system does not recognize not 4 GB?  Don't start with anything any more than 4 GB?

  • Re: Satellite C660-21Z - password lock

    Hello Again Toshiba Satellite C660-21Z which I set up with no problem and all updates loadedI can't get past the Welcome screen and the message is to reset the password with the use of usb flash stick and password recovery disk. How to do this or wha

  • Why can't I open my Facebook email?

    Original title: WF87VZ82wR why I can't open my facebook email...