locked
how to Custom Virtual Machine Properties for ram and cpu count IN ACTION XML ? RRS feed

  • Question

  •  New-VM -Template $VMTemplate -Name $VMName -Description "Virtual machine created from a template with a script" -VMHost $VMHost -Path $VMPath -JobGroup $VMJobGroup -RunAsynchronously -Owner "CONTOSO\Phyllis" -ComputerName "*" -OrgName "" -TimeZone 4 -JoinWorkgroup "WORKGROUP" -AnswerFile $null -RunAsSystem -StartAction NeverAutoTurnOnVM -StopAction SaveVM 

    HOW TO ADD the ram and cpu count properties to NEW-vm???

    THANKS !!!

     


    Thursday, July 14, 2011 8:50 AM

Answers

  • Hi,

    1. You need to define MemoryinMB and CPUCount as Custom virtual machine property.  To define custom virtual machine property, please refer to topic "Defining a Custom Virtual Machine Property for Tasks in the CreateVM Action" in VMM08R2_VMMSSPExtensibilityGuide.
    2. Add "-CPUCount $CPUCount -MemoryMB $MemoryinMB" to New-VM cmdlet in createVM script.
    3. Pass the values for $CPUCount and $MemoryinMB as custom virtual machine properties from runtime parameters.

    Thanks,

    Santosh..

    • Proposed as answer by Santosh Karale Thursday, July 14, 2011 6:44 PM
    • Marked as answer by beans_vmm Friday, July 15, 2011 6:25 AM
    Thursday, July 14, 2011 6:42 PM

All replies

  • Hi,

    1. You need to define MemoryinMB and CPUCount as Custom virtual machine property.  To define custom virtual machine property, please refer to topic "Defining a Custom Virtual Machine Property for Tasks in the CreateVM Action" in VMM08R2_VMMSSPExtensibilityGuide.
    2. Add "-CPUCount $CPUCount -MemoryMB $MemoryinMB" to New-VM cmdlet in createVM script.
    3. Pass the values for $CPUCount and $MemoryinMB as custom virtual machine properties from runtime parameters.

    Thanks,

    Santosh..

    • Proposed as answer by Santosh Karale Thursday, July 14, 2011 6:44 PM
    • Marked as answer by beans_vmm Friday, July 15, 2011 6:25 AM
    Thursday, July 14, 2011 6:42 PM
  • thanks ,I restart machine & recreate vm ,then all right.......
    Friday, July 15, 2011 6:26 AM