After the VMWARE Powercli guide Frustration

$newvm.vmwareNEW.newvm | foreach {New-VM-name $_ .name-model $_.} Tmp - StorageFormat $_. SF - Datastore $_. DS - VMHost $_. VMH | set-vm - memorygb $_. RAM - numcpu $_. CPU-confirm: $false | Get-hard drive | together-hard drive - data store $_. DS - StorageFormat $_. SF - CapacityGB $_. HD-confirm: $false | new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NHD-confirm: $false | new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NNHD-confirm: $false | new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NNNHD-confirm: $false | new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. {NNNNHD-confirm: $false}

It comes to getting the error message:

WHY the name argument is empty?

New-VM: could not validate the argument on the parameter 'name '. The argument is null or empty. Provide an argument that is not

null or empty and then try the command again.

On line: 1 char: 48

+ $newvm.vmwareNEW.newvm | foreach {New-VM-Name $_.} Name - model $_. Tmp-storage...

+                                                ~~~~~~~

+ CategoryInfo: InvalidData: (:)) [new-VM], ParameterBindingValidationException)

+ FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

It has been chewed when it has been posted on the forum so I had a go at reformatting. I also added the missing "get-content" to load the XML file (which may explain why you receive the question "empty or null.")

[xml] $newvm = Get-Content prophix.xml

newvm.vmwareNEW.newvm | foreach {'}

New-VM-name $_ .name-model $_. Tmp - StorageFormat $_. SF - Datastore $_. DS - VMHost $_. VMH | `

set-vm - memorygb $_. RAM - numcpu $_. CPU-confirm: $false | `

Get-hard drive | together-hard drive - data store $_. DS - StorageFormat $_. SF - CapacityGB $_. HD-confirm: $false | »

new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NHD-confirm: $false | »

new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NNHD-confirm: $false | `

new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NNNHD-confirm: $false | »

new-harddisk - Datastore $_. DS - StorageFormat $_. SF - CapacityGB $_. NNNNHD-confirm: $false '

}

Other things that likely are not what you want...

  • Line 3 - the VMH value in the XML file looks like to try a couple of queries to find a VMware host for the virtual machine. A number of things that do not work

  • The value of VMH will not be executed, so it will try to find a host named "(production de get-cluster |)" Get-vmhost | (get-random) ' rather than the command and returning a value
  • If the cluster is active DRS it's easier to use - ResourcePool (get-cluster production) and let the DRS know where to place the virtual computer. By practice (production of get-cluster | get-vmhost | get-random) the code can try and place the new virtual machine on the hosts that are down, disconnected or in maintenance mode (and fails), while DRS will avoid the hosts for the initial investment
  • Line 4 - code seems to assume that $_ always object references a 'newvm' from the XML file. This isn't happening, rather each time you "pipe" $_ done refers the previous result. So the line $3 _ is a newvm object and things like $_.name work as expected. Online $4 _ is now being VM returned by New - VM, not the newvm object from the XML file. So things like $_. RAM and $_. CPU will be null since $_ is not what the script expects it to be.
  • Line 6 - here is an object pipeline as new hard drive is powered a hard disk object in the pipeline (all-hard drive has returned an object of hard drive) and new-harddisk cannot use a hard drive as the input object (will throw an error "the input object cannot be bound"). The other issue is $_. SF and $_. NHD will $Null because what is in the pipeline is not an object 'newvm '.
  • Line 6-9-only the first entry in the XML file has several entries of size of hard disk (NHD, NNHD, etc.). The code will trigger errors when you try to create virtual machines with less than 4 drives as the CapacityGB will (try) to be set to $Null that is not valid
  • Because the code ends with the bad object in the pipeline, most of the time probably to iterate instead of trying to any pipeline. A small change in the XML file is necessary so that VMH is simply the name of the cluster (production). I have not tried running this code with your XML file, but it should give you a start to work from (the NHD, NNNHD, NNHD, etc. could be converted into a loop "foreach" If XML has changed so that there are multiple instances of the NHD element rather than the names of different elements for example)

    [xml] $newvm = Get-Content prophix.xml

    {foreach ($vm to $newvm.vmwareNEW.newvm)}

    $CurVM = new-VM-name $vm.name - model $vm. Tmp - StorageFormat $vm. SF - $vm data store. DS - ResourcePool (get-cluster $vm. VMH)

    $CurVM | set-vm - memorygb $vm. RAM - numcpu $vm. CPU-confirm: $false

    $CurVM | Get-hard drive | together-hard drive - data $vm store. DS - StorageFormat $vm. SF - CapacityGB $vm. HD-confirm: $false

    If ($vm. NHD - don't $Null) {}

    $CurVM | new-harddisk - $vm data store. DS - StorageFormat $vm. SF - CapacityGB $vm. NHD-confirm: $false

    }

    If ($vm. NNHD - not $Null) {}

    $CurVM | new-harddisk - $vm data store. DS - StorageFormat $vm. SF - CapacityGB $vm. NNHD-confirm: $false

    }

    If ($vm. NNNHD - not $Null) {}

    $CurVM | new-harddisk - $vm data store. DS - StorageFormat $vm. SF - CapacityGB $vm. NNNHD-confirm: $false

    }

    If ($vm. NNNNHD - not $Null) {}

    $CurVM | new-harddisk - $vm data store. DS - StorageFormat $vm. SF - CapacityGB $vm. NNNNHD-confirm: $false

    }

    }

    Tags: VMware

    Similar Questions

    • Unable to connect to the desktop after the Vmware tools update

      Hey guys,.

      I have problems with a Samsung PCoIP device if it refuses to connect to the virtual machine windows 7 since vmware tools has been updated

      I know very little about vmware view, when he tries to connect it connects to the server vmware view, swimming pool and looks like it is going to connect, but all I get is a black screen, then turned to the login prompt

      The PCoIP device can ping the virtual machine

      I can connect to the computer via RDP virtual

      VMware View version 4.6.0 build-366101

      Any help would be great

      The VMware tools install probably brought to light the specific video driver for VMware view. Try reinstalling VMware View Agent and be careful on the VMware Tools updates.

    • T of what guest operating systems will start the VMware Support for EFI?

      Is there a list of support guest OS for the EFI firmware?  Mianly supported by VMware - do not try, fail, call support technique etc etc.   My experiences on the TP forums, I guess that there is not.  Some OS (such as Windows Server) come with a screen to choose BIOS/EFI firmware.  If not, you need to go to setting > Hard Drive OPtions-> advanced _ > boot using EFI.  In particular there at - it versions of Linux that you give you option of BIOS/EFI firmware before the confutation of VM is complete, so the hard drive then be custom.

      We will officially support the EFI firmware for any guest operating system to which all the following conditions are met:

      • We list this guest operating system, supported in the VMware Compatibility Guide for operating systems and your virtualization product.
      • The guest operating system supports EFI in the operating system installation media.
      • Support the guest OS EFI has no catastrophic flaws (for example Fedora 12 x 64, FreeBSD 11, Centos 6.0 through all the 6.2 have catastrophic flaws).

      New computer virtual assistant of 11 workstation has only the option of EFI firmware for Windows clients.  Special mention, do not yet support us Easy Install for non EFI customers in 11 workstations.  For all other customer support EFI OSes, you can do a manual installation after choosing the EFI firmware in the virtual machine settings > Options > Advanced > Boot with EFI instead of the BIOS.

      I don't understand your concern about the personalization of the hard drive... Could you elaborate?

      See you soon,.

      --

      Darius

    • VMware compatibility guide

      I have hp dl380p gen8. Intel xeon processor e5-2650 v2 @2. 60 ghz now I want to check VMware Compatibility Guide for my hardware, but there are 3-4 servers on the Internet of the VMware Compatibility Guide site. which is correct, that I can find. Please help me to find true material on the site Internet of the VMware Compatibility Guide

      ESXi 5.5 u2 @.

      BTW, this model shows only compatible from 55U3

    • Windows Media Center, no handling no series properly after the update of data from Rovi Guide

      I finally got the updated data of the Guide for Des Moines (Iowa), but he does not correctly handle the record series.

      I've seen this problem reported by others, but I don't see a response that Microsoft or Rovi are working on it.

      Anyone know the status of this issue?

      Hello

      Thanks for posting your query in Microsoft Community.

      I can understand how it could be frustrating when things are unusual.

      I will definitely help you.

      According to the description, I understand that you are facing problems for the record series,

      After Windows Media Center upgrade for the Rovi Guide data.

      As the problem occurred after the upgrade, this is due to data Guide Rovi.

      I suggest you contact the Rovi Guide support team.

      http://www.rovicorp.com/support.html

      It will be useful.

      Let us know if you have further questions about Windows, we are happy to help you

    • After the installation of the VMware-VMvisor-Installer-6.0.0.update02-3620759.x86_64-Dell_Customized-A01 ssh service fails

      Hello

      yesterday, I upgraded a few of my guests ESXi to VMware-VMvisor-Installer-6.0.0.update02-3620759.x86_64-Dell_Customized-A01.iso

      But after the restart, everything works well except the SSH daemon.

      I can not connect via SSH to host more. In the settings, everything seems well, ssh daemon is running, and firewall ports are open.

      Something wrong with this version?

      OK, fixed. It was a problem with an older version of PuTTY.

      In the log file, you will find something like:

      auth.log:2016 - 05-07 T 12: 58:09Z sshd [164893]: error: Hm, kex protocol error: type 30 seq 1

      If the old version of PuTTY had the bad protocol settings. You can change it in Putty SSH parameters - KEX to change the order of the algorithm and put "Diffie-Hellman group Exchange" at the bottom.

      Or better yet, download a newer version of PuTTY. It is fixed in newer versions

    • Data store 6.0 VMWare not recognized after the last batch of hotfixes installed on HP custom image

      Hello guys,.

      Maybe you can help me:

      I installed VMWare 6.0 on a server HP ML350 G9 with image OEM offered custom HP, ESXi - 6.0.0 - 2494585-HP - 600.9.3.30.2.

      This works perfectly.

      Now I am trying to apply the latest available official patch (ESXi600-201507001), but it seems to kill some important VIB

      VIBs installed: VMware_bootbank_esx - base_6.0.0 - 0.11.2809209, VMware_bootbank_lsu-lsi-lsi-mr3-plugin_1.0.0-2vmw.600.0.11.2809209, VMware_bootbank_lsu-lsi-megaraid-sas-plugin_1.0.0-2vmw.600.0.11.2809209, VMware_bootbank_misc - drivers_6.0.0 - 0.11.2809209, VMware_bootbank_sata - ahci_3.0 - 21vmw.600.0.11.2809209, VMware_bootbank_scsi - hpsa_6.0.0.44 - 4vmw.600.0.0.2494585, VMware_bootbank_scsi - mpt2sas_19.00.00.00 - 1vmw.600.0.0.2494585

      VIBs deleted: Hewlett-Packard_bootbank_scsi - hpsa_5.5.0.106-1OEM.550.0.0.1331820, LSI_bootbank_scsi - mpt2sas_15.10.06.00.1vmw - 1OEM.550.0.0.1198610, VMware_bootbank_esx - base_6.0.0 - 0.0.2494585, VMware_bootbank_lsu-lsi-lsi-mr3-plugin_1.0.0-1vmw.600.0.0.2494585, VMware_bootbank_lsu-lsi-megaraid-sas-plugin_1.0.0-1vmw.600.0.0.2494585, VMware_bootbank_misc - drivers_6.0.0 - 0.0.2494585, VMware_bootbank_sata - ahci_3.0 - 21vmw.600.0.0.2494585

      The next time I reboot the server, the data store is not available, no more and I have to do a restore. I suspect that the new bootbank_hpsa is the origin of the problem.

      So, how to install the latest patch without losing the data store connectivity?

      Thank you

      What should work, is to download the latest driver hpsa in the/hpq/latest/esxi-600-devicedrivers Indexand install it just after the connection of the host (prior to restart it). The .zip file contains a bundle off line as well as the .vib file.

      André

    • VMWare 4.1.4 stopped working after the upgrade to Yosemite

      Hello

      I bought VMWare Fusion 4.1.4 a few years ago to work on linux and was satisfied with the experience. It has excellent performance and works perfectly.

      I stopped using it for a while, and my mac had updates to Yosemite in the meantime.
      Now that I need to run it again, it does not start and I have an error message saying that this version of the software cannot open on this version of the operating system.

      Do to restore the functionality of my VMWare?

      What can I do else?

      Thank you

      Hello thread974

      Welcome to the VMware communities forum.

      I'm sorry to inform you that Fusion 4.x does not work under OS X Yosemite, as you have already discovered by yourself.

      fusion 7.x supports Yosemite and you will be able to run your merge existing 4.x of the Virtual Machines using Fusion 7.

      If you want to test the latest version of the Fusion to see if it is worth your spending, you can install and run a fully functional version of 30 days before actually committing to spending anything.

      After 30 days, you purchase a license to modify the merger installed in an unlimited version.

      For the assessment of the merger's direct download link

      hope this helps,

      --

      Wil

      PS: My apologies if you got this answer many times, I had misconfigured my browser user agent string.

    • Internal error of the View Composer. Contact your administrator. After the upgrade using VMware-viewconnectionserver-x86_64 - 6.0.0 - 1884746, I can't edit the AutomatedDedicatedComposerPool

      Hello.

      Some panic here.

      After the upgrade using VMware-viewconnectionserver-x86_64 - 6.0.0 - 1884746, I can't edit the AutomatedDedicatedComposerPool

      I get internal error View Composer. Contact your administrator.

      Help, please.

      Best regards

      Peter

      Hmm

      Apparently available allow was to be done by right-clicking in the pool and enable provisioning on the Provisioning... tab. Not on the status button in the overview of Ddesktop pools.

      Dang.

      Best regards

      Peter

    • can anyone guide for after the development of a plugin effects?

      Can anyone guide for after the development of a plugin effects?

      His strong to find directions to make a.

      Wrote scripts in script extended with the support of the community, adobe and online tutorials.


      But I know that Plugin development is not an easy task, but my curiosity is killing me if I don't try. Can someone please guide.

      I downloaded the SDK CC 2015. There are lots of examples, model Skelton, CEAP folder. All Visual studio solutions.

      When I try to open it, it says no loaded project that some components are missing, reinstall using microsoft visual studio c++ 2015.

      Can someone just to share a very small brief step by step from the beginning to the end.?

      .Aex format encoding?

      Thank you

      in the project settings, you can change the directory 'exit' to anywhere where

      you would like to.

      Ideally, you will set it to EI, or another folder plug-in directory

      in which you can create a shortcut to the plugin directory of the AE.

      in this way, you can build directly in a folder AE readings and debug your

      plugin.

    • Keyboard does not not after the Conversion of VMWare

      Hello

      I'm trying to run a VMware Conversion of an old laptop as a backup. I run a conversion of VMware and converted in an image of VM® file 9.

      When it is opened in VMware Player, everything works except for the keyboard entries. The only way I can tap on the screen is using either on the keyboard of the screen or connection with TeamViewer.

      Research in Manager device indicates the following error message.

      Windows cannot start this hardware device because its information of configuration (in the registry) is incomplete or damaged. (Code 19)

      Someone has encountered this before and whether a solution?

      Thank you

      Peter Sheridan

      Update:

      I got it to work. I followed the steps described in the following Article and it worked like a charm

      No keyboard or mouse after installing the Mouseware Drivers from Logitech 9.0 on Windows 2000

      • On the registry menu, click Select computer, and then type the computer name of the computer on which no keyboard or mouse.
      • After logging in, click on Hkey_Local_Machine on the Remote_Computer_Name in the menu window , and then navigate to the following key:
        SYSTEM\CurrentControlSet\Control\Class\ {4D36E96B-E325-11CE-BFC1-08002BE10318}
      • Double-click on the UpperFilters:REG_MULTI_SZ: Lkbdflt2 kbdclass value and then remove only the Lkbdflt2 entry.
      • Navigate to the following registry location:
        SYSTEM\CurrentControlSet\Control\Class\ {4D36E96F-E325-11CE-BFC1-08002BE10318}
      • Double-click on the UpperFilters:REG_MULTI_SZ: Lmouflt2 mouclass value and then remove only the Lmouflt2 entry.
      • On the registry menu, click close.
      • On the registry menu, click exit.
      • Restart
        the computer with keyboard and mouse problems. After the computer
        restarts, the mouse and the keyboard should be functional.
    • problems VMWare player after the upgrade of windows7 for windows8

      Hello!
      Is it normal to have problems with wmware player after the upgrade of windows7 for windows8?
      first: it was impossible to have lunch at any guest host, I change the value of this line: "vmci0.present" from true to FALSE to start
      and then now, I have no network to all hosts in comments, I tried with the bridge and the NAT mode, it does not work
      and I found this error in the log file:
      VMX | I120: [msg.dictionary.load.openFailed] could not open the file "C:\ProgramData\VMware\VMware Workstation\config.ini": an unknown error (0 x 2) of 2.

      After this file please - looks like a syntax error

    • Help with restarting the laptop HP pavilion g6 auto blue screen after installing VMWare Workstation 7/8

      Hello, I have a HP Pavilion g6-1a52nr Notebook PC (running Windows 7 64 bit) which is in a reboot loop. This happened after I installed VMWare Workstation 7 (in the installation process there is no occurs.but error after installing that I try to reboot the machine, and then the following error has occurred).
      Now whenever the notebook starts up, it seems to be in a reboot loop after the windows logo then get a blue screen.
      When I connect to the system using vmware safemode also working.but in normal mode it displays a blue screen after logiin screen shows.

      By turning on the restart automatic system failure off I was able to read it as the Blue error message that says:
      -

      Signature of the problem:
      Problem event name: BlueScreen
      OS version: 6.1.7601.2.1.0.256.1
      Locale ID: 1033

      More information about the problem:
      BCCode: 1000007e
      BCP1: FFFFFFFFC0000005
      BCP2: FFFFF88006EFF443
      BCP3: FFFFF88003399D68
      BCP4: FFFFF880033995C0
      OS version: 6_1_7601
      Service Pack: 1_0
      Product: 256_1

      Files helping to describe the problem:
      C:\Windows\Minidump\031212-28672-01.dmp
      C:\Users\user\AppData\Local\Temp\WER-62072-0.SysData.XML

      Read our privacy statement online:
      http://go.Microsoft.com/fwlink/?LinkId=104288 & clcid = 0 x 0409

      If the online privacy statement is not available, please read our offline privacy statement:
      C:\Windows\system32\en-US\erofflps.txt


      -
      Can someone give me advice on how to solve and prevent this problem?


      Thank you

      you have the HP-tools installed?
      They often conflict with VMware.
      Try disabling the startup of the HP-tools

    • Solaris VM is not running on ESX4.0 after the conversion of VMware workstation 6.5

      I have created Solaris VM on VMware workstation 6.5, but now I want to run it on ESX 4.0. After the conversion of Solaris VM from VMware workstation in format by converter 4.0.This VMware ESX VM restarts again and again on the boot of power.

      VMware workstation is running on Intel (R) Xeon (R) CPU E5420 and ESX 4 running on the Unisys ES3220L system

      Help, please...

      How was the original virtual controller?

      If it's IDE, you will need to also change SCSI to IDE on ESX 4.0.

      André

    • 17 GB of drive space missing after the crash of vmware fusion and force restart

      During my last installation of SuSE Linux, I had to manually reboot my system because my system crashed.

      After the reboot, I deleted the virtual machine of Susa and started again installation. To my surprise 17 GB were mission on my hard drive and I can't find the files responsible for this. I checked my system of files larger than 500 MB via ' find /-size M + 500 ", but found nothing: (.)

      Do you know where are the 17 GB or where vmware fusion may have experienced a system core dump or something like that?

      Please help, I need the 17 GB for resettlement :).

      Thank you.

      Simon

      I have discovert that was missing only 3 GB of the 20 GB that I deleted before trying to install SuSE. But I deleted all the files that I specified after the crash. The trash is always empty so I'm a bit confused were are the 17 GB.

      Refer to the section of the disk space of FAQs on VMware Fusion

    Maybe you are looking for