"expects a single value / corresponds to multiple values" error script New - vm in PowerCLI

I have been responsible for creating some 800 + virtual desktops so, naturally, this is something I want to script.  After reading through the large bases of knowledge here, I was able to create what I thought, it was the correct code.  It worked when I was just "write-host" ing lines command to see if the variable creation/uasge worked well.  When I removed the lines of write-host and tried to use the actual orders new-vm, I started having different "of the specified parameter '$vmhost' expects only one value, but your criteria of name ' xxx - vm53.yyyyyyyyy.com' correspondingponds to several values." errors.  Here is my code, marked specificities:

Add-PSSnapin VMWare.VimAutomation.Core # PowerCli add script environmen t
$creds = get-vicredentialstoreitem-'c:\temp\credfile.xml' # chopped access file password to authentice with "sys" service account from the file
connect-viserver-Server $creds.host-$creds.user username-password $creds.password
$host1 = get-cluster "HVD1" | get-vmhost | Tri-objet "memoryusagemb" | Select-object - 1 first | foreach {$_.name} # get the VMWare hosts with less use of the memory of the cluster host "HVD1" registration
$dstore = get-datastore ' vdi_ * ' | Tri-objet 'FreeSpaceMB' - descending | Select-object - 1 first | foreach {$_.name} # Get datastore disk with most freespace to be VDI_ *
$VMBaseName = "XX-P01-HVD" # definition of trade names XenDesktop hosted
$Template = get-model model-CBD-XD-XP | Select-object - 1 first | foreach {$_.name} # Setting for XenDesktop hosted Commercial model
$OSCustSpec = "CBD - XD XP" hosted # Setting for hosted Commercial XenDesktop customization script
$loc = 'Desktop' # configuration for XenDesktop folder
$ResPool = get-resourcepool XX-P01-HVD | Select-object - 1 first | foreach {$_.name} # XenDesktop hosted Commercial resource pool setting
[int] $FirstNumber = 0
[int] $HostTotal = 0
[int] $ctr = 0

$FirstNumber = Read-Host "enter the first digit to the VMWare host range".
$HostTotal = Read-Host "enter the quantity for the VMWare host range".
$HostNumber = $FirstNumber
$HostFinal = $HostNumber + $HostTotal

do {}
$vmname = $vmbasename + $HostNumber
new-vm - vmhost $host1-name $VMName - $ResPool - $loc location ResourcePool - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizationspec $OSCustSpec # Execute the new VMWare host creation
Start-vm $VMName # start the virtual machine to start the customization process
$HostNumber ++
$ctr += 1
If ($ctr - eq 5) {write-host write-host "break 10 Minutes' sleep s 600; $ctr = 0; write-host} # sleep for 600 seconds every 5 VMs to avoid overloading ESX hosts
} until ($HostNumber - eq $HostFinal)

Here are my mistakes:


New - VM: 23/03/2011-17:42:22 new-VM parameter specified "VMHost.
expects a single value, but your criteria of name ' xxx - vm53.yyyyyyyyy.com' corresponding
ponds to multiple values.
To C:\temp\xx_deploy.ps1:31 character: 7
+ new-vm < < < <-vmhost $host1-name $VMName - $ResPool - $l location ResourcePool
OC - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizat
creating # ionspec $OSCustSpec of the new VMWare host Execute
+ CategoryInfo: InvalidResult: (System.Collecti... dObjectInterop)
(]: List 1) [new-VM], VimException
+ FullyQualifiedErrorId: Core_ObnSelector_SelectObjectByNameCore_MoreResu
ltsThanExpected, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

New - VM: 23/03/2011-17:42:23 new-VM parameter specified ' Resourc
ePool' expects a single value, but your name criteria is "XX-P01-HVD.
multivalued.
To C:\temp\xx_deploy.ps1:31 character: 7
+ new-vm < < < <-vmhost $host1-name $VMName - $ResPool - $l location ResourcePool
OC - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizat
creating # ionspec $OSCustSpec of the new VMWare host Execute
+ CategoryInfo: InvalidResult: (System.Collecti... dObjectInterop)
(]: List 1) [new-VM], VimException
+ FullyQualifiedErrorId: Core_ObnSelector_SelectObjectByNameCore_MoreResu
ltsThanExpected, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

New - VM: 23/03/2011-17:42:23 new-VM parameter ResourcePool: could not
t find any object specified by its name.
To C:\temp\xx_deploy.ps1:31 character: 7
+ new-vm < < < <-vmhost $host1-name $VMName - $ResPool - $l location ResourcePool
OC - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizat
creating # ionspec $OSCustSpec of the new VMWare host Execute
+ CategoryInfo: ObjectNotFound: (VMware.VimAutom, ol ResourcePo)
OL:RuntimePropertyInfo) [new-VM], ObnRecordProcessingFailedException
+ FullyQualifiedErrorId: Core_ObnSelector_SetNewParameterValue_ObjectNotF
oundCritical, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

I had multiple values for some of the entries, that's why I tried to analyze with the first '-1' and outside the script, the values return very well.

Any help?

And this is the cause of the problem.

You feed the New - VM name in fact only 1, and the cmdlet, by OBN, tries to resolve the name into an object.

But since there are 2 connections, it will get an object returned by each connection.

Where the multiple value message.

Check if you have several Connect-VIServers in the script and maybe close all connections before the script starts.

Or switch to simple mode with the Set-PowerCLIConfiguration cmdlet.

Tags: VMware

Similar Questions

  • ERROR: The specified parameter 'Rental' expects a single value, but your name criteria "PROD" corresponds to multiple values.

    Hello

    I am writing a script to create the new VM (base clone of a virtual machine) in a specific folder.

    When you run the script, I get an error:

    The specified parameter 'Rental' expects a single value, but your name criteria "PROD" corresponds to multiple values.

    Some research led me to a post of 2011, which describes the same error. The only thing is, I can find no trace of open connection and then a more...

    What I tried:

    I run the script on the server for vSphere, so I closed the open vSphere client.

    closing ('disconnect-viserver") all existing connections in the first line of the script-> an error because no connection is open.

    In several places in the script, add the following lines:

    ECHO ' - '.

    $DefaultVIServers <-as noted in the post of 2011

    ECHO ' - '.

    This shows that no connection is open until I do the "connect-viserver", subsequently, apparently, that a connection is established.

    the results and the (current) script are found in the files to attach.

    I also found an error on the "set-PowerCLIConfiguration that I can't explain.

    One last question... Is there a possibility to have the new virtual machine created through 3 hosts? the first on the first host, the second on the second, the third on the third, the fourth back on the first host,... and so on?

    Any help would be appreciated.

    Thank you.

    Johan

    Of course, you can provide the full path, for example see my post of folder by Path .

  • travel-vmhost error - the destination of the specified parameter expects a single value

    I run in an error using Move-VMHost under PowerCLI version 5.5 R2 Patch 1 and 5.8 Release 1.

    There are 6 clusters in the data center.  To the host of the virtual machine between 5 of the clusters that I can run successfully:

    Get-VMHost vmhostname | Moving-VMHost Destination 'NOMCLUSTER '.

    But one group in particular always fails when it is specified as destination of the error message:

    The specified parameter "Desintation" expects a single value, but your criteria of name "cluster6" corresponds to multiple values.

    The only way I can get this working is to do:

    Get-VMHost vmhostname | -Move Destination VMHost (get-cluster | where {$_.name - eq "cluster6"})

    How 'cluster6' could correspond to several cluster names?  Is this just a bug in PowerCLI?  I started using PowerCLI more recently and noticed that some cmdlets can be a bit odd (for example had a few other problems with Get-VMHostStorage and found others have had similar problems with it).  I use this process of moving part of a more automated deployment script.  Prefer to make it as efficient as possible without having to insert the extra if possible Get-Cluster command.

    The Destination parameter on the Move-VMHost cmdlet accepts any VIContainer, not only the clusters.

    I suspect it could VIContainer one another with the same name.

    What this does?

    Get-inventory-name 'cluster6 '.

  • AppleScript find and pass variables with a single value for the new string

    Hello again,

    I need a solution to do this:

    We have the string

    {0, 0, '62 21 37', 1, 0, ' 62 21 37 ", 2, 0," 108 50 56 ", 3, 0," 167 102 95 ", 4, 0, ' 108 50 56", 5, 0, "145 84 83", 6, 0, "109 50 58", 7, 0, "109 50 58", 8, 0, "129 62 66", 9, 0, "120 56 62", 10, 0, "104 47 57" "" "" "" "" "} (a few example of result window)

    This is a Pixel data - x, y and RGB as a text

    How can we separate it into different channels organized by RGB, to create something like

    {'109 50 58', 6.0 7.0}

    {'62 21 37', 0,0,1,0}

    {"108 50 56", 2,0,4,0}

    and etc.

    Thank you

    Try using:

    the_string value {0, 0, '62 21 37', 1, 0, ' 62 21 37 ", 2, 0," 108 50 56 ", 3, 0," 167 102 95 ", 4, 0, ' 108 50 56", 5, 0, "145 84 83", 6, 0, "109 50 58", 7, 0, "109 50 58", 8, 0, "129 62 66", 9, 0, "120 56 62", 10, 0, "104 47 57" "" "" "" "" "}

    Set new_strings to {}

    Repeat with 3 to (count elements of the_string) by 3 this_item

    Set temp_list to {}

    If the element the the_string this_item is not in temp_list then temp_list temp_list this_item & point of the_string

    Repeat with this_list_item points of temp_list

    the value new_strings new_strings & (this_list_item as a list)

    end repeat

    Repeat with this_list from 1 to (account new_strings)

    If (this_list point new_strings as String) is point of the_string this_item then

    point Set this_list to {this_list point of new_strings} new_strings & elements (this_item - 1) at (this_item - 2) of the_string

    end if

    end repeat

    end repeat

    Repeat with 1 to (count elements of new_strings) this_list_1

    Repeat with this_list_2 (this_list_1 + 1) (count new_strings elements)

    If this_list_1 point new_strings is not {} and this_list_2 point new_strings is not {}, then

    If the item 1 of article this_list_1 of the new_strings is point 1 of article this_list_2 of the new_strings then

    point Set this_list_1 of new_strings to the point of new_strings this_list_1 & (items 2-3 (point get new_strings this_list_2))

    this_list_2 point new_strings value {}

    output of repetition

    end if

    end if

    end repeat

    end repeat

    Set result_string to {}

    Repeat with this_string in new_strings

    If this_string is not {}, and then assign result_string result_string & this_string

    end repeat

    (143290)

  • Convert multiple lines in a single value separated by commas

    Is is possible to convert multiple lines in a single value by concatenating the value of each line in OBIEE. I think that IO had seem a blog related to this by I'm not able to find him. Essentially, here's what I would do:
    Number of customer location
    101
    101 NY
    101 PA
    102 TX
    102 CA

    This is to convert
    101. HE, NY, PA
    102 TX, CA

    Can you get it someone please let me know if this is possible and how to operate it.

    Thanks in advance for the help.

    You can do this by creating a DB function,

    Visit this link
    Re: Display of the horizontal values

    Thank you
    Vino

  • Retrieve a single value from a file .lvm

    I have a large batch of files of worksheet whose name is a timestamp. I am writing a program that will get the value of a specific cell (the same cell in each file), coupled with the timestamp and each of them as a pair of coordinates, then save in a master spreadsheet. The goal is to extract a point each of the 700 files I and compile them into a single file.

    However, I've never used Labview to read the files before. I saw some stuff on how to read an entire worksheet in a table, but I was wondering if there was a way to say to Labview to look into a file and extract a single value. I open .lvm in Excel files, so, in my mind, I would be taking, for example, cell D2. Is this feasible? Should I read the entire worksheet in an array and use the index to pick it up on the table? If I do, how I would specify cell J2 as an array index (I have no experience with the berries in Labview either). In addition, if you have any tips on how to record easily 700 pairs of coordinates, that came together in the order, to a single spreadsheet, that is my next task.

    Essentially- I need to extract a single value of a spreadsheet in, ideally, the simplest possible. In addition, pointers on how to save the numbers gathered at each iteration of a while loop to a single worksheet are welcome.

    Thanks in advance for the help!

    FYI I have LabView v8.6

    You can't say LabVIEW to 'out' a specific 'cell' more you can tell Notepad to do. the .lvm files are just text files. When you open them in Excel, the column separator (default tabs) show to put the values in columns. In LabVIEW measurement file VI reading to read .lvm files. It creates the dynamic data, wrong data type that is next to useless. You will need to convert this type of data in a table by using the function convert of DDT. Or, you can use the VI read spreadsheet file. This will give you a table directly. You can just remove the specific item using the table to Index.

  • How to write a single value in an excel spreadsheet

    Hello

    I use an excel spreadsheet, as if it were an external code module. He does a lot of calculations, all I do is write an individual value, let calculate what it should only then read a return value from this.

    I already have a structure able to read a table, but could someone help me with a piece of code that could write a single value?

    (To read a value unique too may be practical)

    Also, I have the new LabVIEW 2009, so while a fancy to drop some code here as one. PNG, it would be nice to see if this new feature works!

    Thank you, Alec

    Try this. There are 2 point methos (get) and point (put) to read and write the value respectively to a cell in excel.

    Good luck

  • With a single value pie chart

    Hello Experts,

    I am new to the apex.
    I want to draw a pie with a single value.
    that one value should resemble a slice in the pie chart.
    I tried, but it shows that any graph as a value.

    So please help me in this regard.
    Its very urgent.
    Please, I beg you.

    Hello

    I don't know if I understand your question, you want to pie chart or line chart? If you draw two lines in a single chart, you add another series to the chart. Click on the graph and click on add another series, enter another sql for the series and you should be all set. Thank you.

    Kind regards
    Manish

  • Text editor enriched ORA-06502: PL/SQL: digital or value error: character string buffer too small

    Hello

    I have apex user 4.2.3 with enterprise database edition 11, I page include RICH TEXT EDITOR, when I add data to this text and save it will record successfully and when I try to view this information in another page I see all the data, as expected, the problem when I try to go to the same page as RICH TEXT EDITOR error message apper ORA-06502 : PL/SQL: digital or value error: buffer string too small, I see this link https://forums.oracle.com/thread/2461151?tstart=0 but I don't know how it solve it, the problem is made data at the point of the rich text editor.


    Any suggestion?


    Thank you

    Thanks for the reply,

    Its standard form with text rich field, my question she same as link above I added before

  • Character LOV value error

    Hello

    I have the following problem:

    When using LOV in my form of tabular, that I'll meet with this error:

    error report:
    ORA-06502: PL/SQL: digital or value error: character string buffer too small


    It seems that the number of values returned to the total of all my LOV is too hard to handle? Even if I use APEX_ITEM. SELECT_LIST_FROM_LOV_XL) in my application, I get this message!

    How can I use multiple LOV in my editable report without getting this error? Is this a bug?

    I use APEX 3.1.2.00.02

    Published by: Voxie2 on June 25, 2010 14:35

    Hello

    have you had a glance at the "Popup LOV key" APEX 4.0? He thinks that's what you want to use. This type is available as a type of column in the declarative form as well. If you need to use it in a requpete SQL, you can use

    apex_item.popupkey_from_query or apex_item.popupkey_from_lov
    

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • PL/SQL: digital or value error: string buffer too small characters - LOV?

    Environment:

    APEX 3.1.1.00.09 under AIX 5.3 10.2.0.2 in

    Problem sample on apex.oracle.com:

    Workspace: GALWAY
    ID: GWICKE
    Password: GWICKE

    Application ID: 43172 (BUILDERPL) NOTE: there are three 3 applications with the same name, but this one is currently broken

    I get the dreaded "" ORA-06502: PL/SQL: digital or value error: character string buffer too small "when you try to create a new line."

    To reproduce the error:

    1 run page 3
    2 - Select any agency
    3 - Click on the button "create a new contract.
    4 - Select the start and end dates in the DATE picker
    5 - Click on the button "Add contract".

    If the line is added successfully if please go to Indianapolis and run the app for me since you obviously have the 'touch '! ;-) >

    But seriously folks,

    I've read many threads about this error and for the most part, they seem to point to large LOV. I have three 3 LOV on the page but only a 1 is dynamic and display and back elements are the same, a description in this case. There are 400 lines in the LOV table and the description is defined as VARCHAR2 (75), so we're not talking a huge amount of data.

    To further complicate the issue, this application was working just a couple of days. What changes I've made since a few days, you might ask?

    The only thing that comes to mind is I did go through the definitions of element and change the values of maximum size equal to the size of the columns in the target table, using a value of 22 for the NUMBER of columns.

    Since then I went back and changed at a much greater value than their corresponding column definitions, but nothing helped.

    Another interesting fact is that if an existing contract is selected on the page (Page 3 in my case) by selecting an agency that produces values in the second select list (selection of contract) and then clicking on "change this contract." After you change any value or fill in one of the missing values, click "Apply Changes" and he should have success.

    The new contract page and the page of modification of the contract are the same (Page 2) just with different buttons.

    Thanks a lot for any assistance. Indeed, it is greatly appreciated.

    -gary

    PS I also tried to change the LOV both given a popup and a standard text box I typed in, both received the same message.

    Gary - I deleted then recreated your DML process and it seems to have solved the problem. Export page reveals something odd in the process definition:

    declare  p varchar2(32767) := null;  l_clob clob;  l_length number := 1;beginp:=p||'F|#OWNER#:BUILDERPL_CONTRACT:P2_CONTRACT_SEQ:CONTRACT_SEQ|I';
    
    wwv_flow_api.create_page_process( ...
    

    That the assignment statement must not have ' F | "as the first two characters. There must be a bug in one of the wizards who created the process. Have you used a wizard to create the page?

    Scott

  • Code example for single asynchronous reading of multiple waveforms

    Hello

    I looked around but have not been able to find the code example for single asynchronous reading of multiple waveforms.  Could someone point me in the right direction?

    Thank you

    Dale

    Hi Dale,

    Have you looked at the code using .NET Framework DAQmx example? It shows this code:

    class DAQmxAsyncRead
    {
    private AnalogSingleChannelReader reader = null;

    public DAQmxAsyncRead (task t)
    {
    Create the drive
    Reader = new AnalogSingleChannelReader (t.Stream);
    Acquire 100 samples
    Handful of IAsyncResult = reader. BeginReadMultiSample (100, New AsyncCallback (OnDataReady), null);
    }

    Public Sub OnDataReady (IAsyncResult i)
    {
    Recover data that has been read.
    At this point, all that occurred during the asynchronous read exceptions are thrown
    Double data = reader. EndReadMultiSample (i);

    You can call the method BeginReadMultiSample here once again
    }
    }

    In addition, this article: http://digital.ni.com/public.nsf/allkb/485201B647950BF886257537006CEB89?OpenDocument talk about different causes of the reserved resource error.

    Kind regards

    Alexandra Valiton

  • [Labview] I want to get the average value in each new 100 samples.

    Hello. I'm Sophie.

    I'm studying Labview for my research.

    For me, the sampling frequency is 125KHz.

    I want to get the average value in each new 100 samples.

    Therefore, I want to get an average value of 1 ~ 100th samples and store this average value. Call assets(1).

    Then, I want to get an average of 101 ~ 200th samples and store this means value, call moyen2.

    .

    .

    .

    .

    I don't know how me I want.

    Thank you

    Sophie.

  • Unable to save the good value error - 3020 hub

    We have a production 3020 VPN concentrator, who has started having a problem a couple of days. When we make a change, we receive a popup box saying could not save a bad value error. We restarted the concentrator once and found that it did not have to register once. Now, back to the error. Because it is a production supporting many tunnels, restarting is very disruptive, and we lose all our changes. Any ideas on what causes this error and how to fix it?

    Excellent! good to hear, remember messages useful rate.

  • ORA-00947: not enough values error collect in bulk

    Hi guys,.

    I'm trying to COLLECT in a PL/SQL table, but I get ORA-00947: not enough values error message, even if the table has 4 values and select 4 values. Am I missing something?

    I have to add something to this?

    I've included the types of database objects that I created on the database.

    I have commented on the Original code and used the table DOUBLE just to make simple workout.

    /*

    CREATE or REPLACE TYPE Usage_Groups_for_coda_rec as

    object

    (Usage_Group_ID NUMBER (10),)

    Coda_comment VARCHAR2 (45).

    Amount NUMBER,

    Deduction_amount NUMBER);

    CREATE OR REPLACE

    TYPE USAGE_GROUPS_FOR_CODA_TAB AS

    TABLE OF Usage_Groups_for_coda_rec;

    */

    declare

    -CURSOR c_adj_roy_trans

    -EAST

    -SELECT DISTINCT rotr.on_behalf_of_soc_nbr, rotr.right_type

    -OF royalty_transaction rumble

    -WHERE rotr.ps_adjust_royalty_flg = cm_default.get_yes;

    CURSOR c_adj_roy_trans

    IS

    SELECT '052', 'P '.

    DOUBLE;

    t_uge_Grp_for_coda_tab USAGE_GROUPS_FOR_CODA_TAB; -the type of table was created on the database

    Start

    FOR r_adj_roy_trans IN c_adj_roy_trans LOOP

    -SELECT rotr.usage_group_id as Usage_Group_ID,

    -cm_coda_account_default.get_canc_adj_coda_comment | '- CAE' as Coda_comment,

    -SUM (NVL (rotr.gross_amt, 0) + NVL (rotr.reciprocal_deduction_amt, 0)) as an amount

    -SUM (rotr.reciprocal_deduction_amt) as Deduction_amount

    -COLLECT LOOSE t_uge_Grp_for_coda_tab

    -OF royalty_transaction rumble

    -WHERE rotr.ps_adjust_royalty_flg = cm_default.get_yes

    - AND rotr.on_behalf_of_soc_nbr = r_adj_roy_trans.on_behalf_of_soc_nbr

    - AND rotr.right_type = r_adj_roy_trans.right_type

    -Rotr.usage_group_id group;

    SELECT 6874534 as Usage_Group_ID,

    "This is a test - CAE" as Coda_comment.

    100 as an amount

    50 as Deduction_amount

    LOOSE COLLECTION t_uge_Grp_for_coda_tab

    DOUBLE;

    /*

    IF l_uge_Grp_for_coda_tab. COUNT > 0 THEN

    cm002p.std_coda_post_cashing_out_bulk (p_on_behalf_of_society_number = > r_adj_roy_trans.on_behalf_of_soc_nbr,)

    p_right_type = > r_adj_roy_trans.right_type,

    p_Usage_Groups_for_coda_tab = > t_uge_Grp_for_coda_tab,

    p_reverse_posting_direction = > FALSE,

    p_posting_override_direction = > NULL,

    p_cohi_id = > NULL

    );

    END IF;

    */

    END LOOP;

    end;



    Here's what you need to do:


    SELECT Usage_Groups_for_coda_rec(6874534, "It is a test - CAE", 100, 50)

    LOOSE COLLECTION t_uge_Grp_for_coda_tab

    DOUBLE;

    You try bulk collect into a collection of Usage_Groups_for_coda_recs, then you will need to make type compatible using the implicit of the type constructor.

Maybe you are looking for