locked
customise VM memory via SSP 2.0 RRS feed

  • Question

  • Hi,

    I would like to know if there is any option in VMMSSP 2.0 for any business unit to customise RAM for his VM.

    Because it seems that the provisioning is not totally automatic if the end user cannot choose the amount of RAM for his VM that he needs...


    MCITP: DBA 2008 Admin, Server Admin, Virtualization 2008 R2 Admin | CCA: Citrix Certified Admin | MCTS: Configuring Exchange 2007 | MCSA: Messagig 2003
    Thursday, July 7, 2011 12:59 PM

Answers

  • Hi,

    You can customize create Virtual machine task in the Master Action xml and define Variable in param param($RAMKey, $CPUCountKey) section and add switches for Memory and CPU Count in New-VM  (–MemoryMB $RAMKey,  –CPUCount $CPUCountKey). Here are the detail steps.

    For Creating and Using Custom Virtual Machine Properties, you need to do following.
    1. Create and configure the custom action XML segment
    2. Provision a service role to use the modified CreateVM action
    3. Create a virtual machine using the new custom properties

    To create and configure the custom action XML segment
    1. In the self-service portal, on the Settings tab, click Customize Virtual Machine Actions.
    2. On the Settings: Customize Virtual Machine Actions page, in the list of action XML segments, click the segment you want to copy, and then click Copy action XML. The self-service portal creates the new action XML segment and opens the Edit Actions form.
    3. In the Information section, in the Name box, type a new name for the action XML segment, and then click Save.
    4. In the CreateVM section, use the following steps to create the custom virtual machine properties RAM and CPU Count.
         a. Click Add Custom Virtual Machine Property.
         b. In the Add Custom Virtual Machine Property dialog box, define a property named RAM. Give the details like Key, Display Name, Description and Default Value.
        c. When finished, click Save to close the dialog box.
        d. Repeat steps a-c to define a property named CPUCount.
            The Edit Action form lists both new properties in the CreateVMsection.
    5. In the Tasks pane of the Edit Action form, click Save to save the new custom properties.
    6. In the CreateVM section, next to CreateVMTask, click Edit to open the Edit Task for Action form.
    7. Add the new custom properties as input parameters for the script, using the following steps:
         a. In the Edit Task for Action form, in the Input Parameter section, click Add Parameter.
         b. In the Add Parameter dialog box, in Key, type RAMInMB as the key name for the new parameter.
         c. Under Value, click Runtime Value, and then click DataItem to expand the list of available values.
         d. Click CustomVirtualMachineProperties, and then click RAMKey.
            This configuration sets the parameter value to the expression $DataItem/CustomVirtualMachineProperties/RAM$, which the script evaluates at run-time.
            When finished, click Save to return to the Edit Task for Action form.
          e. Repeat steps a-d to create another parameter, using the key name CPUCountKey and the runtime value    $DataItem/CustomVirtualMachineProperties/CPUCount$.
    8. In the Lock Script box, modify the lock script to use the new parameters.
          a. In the param statement, add $RAMKey and $CPUCountKey to the list of variables.
          b. Modify each of the three New-VM statements to add the switches –CPUCount $CPUCountKey and –MemoryMB $RAMKey.
    9. In the Tasks pane of the Edit Task for Action form, click Save and Close.
    10. In the Tasks pane of the Edit Action form, click Save and Close.

    To provision a service role to use the modified CreateVM action
    • When you provision a service role, in the Action XML section of the Edit Service Role form, select the custom action XML segment that you created previously in this example.
    For more information about provisioning service roles, see the topic “Provisioning a Requested Service Role or Service Role Change” in the Help or the Virtual Machine Manager Self-Service Portal 2.0 SP1: Datacenter Administration Guide.

    To create a virtual machine using the new custom properties
     1. When you create a virtual machine, in the Join Infrastructure section of the Create Virtual Machine wizard, verify that the selected service role is the service role you configured to use the custom action XML segment.
    The Create Virtual Machine wizard includes a new section, Custom Virtual Machine Properties, that includes the custom properties RAM and CPU Count and their default values.
    2. To use values other than the defaults, type new values for RAM and CPU Count.
    3. Finish configuring the new virtual machine normally. When you have finished the Create Virtual Machine form, click Create. For more information about creating virtual machines, see the topic “Creating Virtual Machines” in the Help or the Virtual Machine Manager Self-Service Portal 2.0 SP1: Datacenter Administration Guide.

    Thanks,
    Santosh

     

    • Proposed as answer by Santosh Karale Friday, July 15, 2011 7:01 PM
    • Marked as answer by ILeaveIT Sunday, July 17, 2011 11:49 AM
    Friday, July 15, 2011 7:00 PM

All replies

  • Hi,

    By Default VMMSSP 2.0 takes the RAM of the template from which virtual machine is created. However there are couple of approaches for customizing RAM.

    1.DCIT Admin can customize create VM Script to use RAM as per requirement and associate that action XML with required service role. Here RAM customization will not be available to end user and template RAM will be considered for chargeback calculation.

    2.Create multiple templates with required RAM. Here end user can select the template during create Virtual Machine wizard and chargeback will consider RAM of the selected template.

    Second approach should be good in your scenario.


    Thanks,

    Santosh.

    • Marked as answer by Santosh Karale Thursday, July 7, 2011 5:24 PM
    • Unmarked as answer by Santosh Karale Thursday, July 7, 2011 5:24 PM
    • Proposed as answer by Santosh Karale Thursday, July 7, 2011 5:24 PM
    • Unproposed as answer by ILeaveIT Sunday, July 10, 2011 6:32 AM
    Thursday, July 7, 2011 5:24 PM
  • Hi santosh,

    The 1st approach seems like something I', looking at...how do I use it?


    MCITP: DBA 2008 Admin, Server Admin, Virtualization 2008 R2 Admin | CCA: Citrix Certified Admin | MCTS: Configuring Exchange 2007 | MCSA: Messagig 2003
    Sunday, July 10, 2011 6:33 AM
  • Hi,

    In the first approach you need to modify create virtual machine script to take specific value for the parameter -MemoryMB but end user will not be able to select RAM during create virtual machine. Please refer section "Creating or Modifying an Action XML Segment" in the VMM08R2_VMMSSPExtensibilityGuide.

    Also please note that Microsoft System Center Virtual Machine Manager Self-Service Portal 2.0 SP1 is released and available for download at http://go.microsoft.com/fwlink/?LinkId=196742.

    This version provides the feature to "Define and use custom virtual machine properties". A datacenter administrator can define custom properties to collect information from users in the Create Virtual Machine wizard, and use these properties in the tasks of the CreateVM virtual machine action. For example, a datacenter administrator can create the properties RAM and CPU Count. Then the Create Virtual Machine wizard includes fields for RAM and CPU Count. When a user finishes the wizard, the wizard passes the RAM and CPU count values that the user entered to the tasks in the CreateVM virtual machine action.

    Thanks,
    Santosh..

     

     

    • Proposed as answer by Santosh Karale Tuesday, July 12, 2011 10:38 PM
    Tuesday, July 12, 2011 10:37 PM
  • who can provide a full scripts ?

     

    thanks very much!!!

    Friday, July 15, 2011 1:28 AM
  • Hi,

    You can customize create Virtual machine task in the Master Action xml and define Variable in param param($RAMKey, $CPUCountKey) section and add switches for Memory and CPU Count in New-VM  (–MemoryMB $RAMKey,  –CPUCount $CPUCountKey). Here are the detail steps.

    For Creating and Using Custom Virtual Machine Properties, you need to do following.
    1. Create and configure the custom action XML segment
    2. Provision a service role to use the modified CreateVM action
    3. Create a virtual machine using the new custom properties

    To create and configure the custom action XML segment
    1. In the self-service portal, on the Settings tab, click Customize Virtual Machine Actions.
    2. On the Settings: Customize Virtual Machine Actions page, in the list of action XML segments, click the segment you want to copy, and then click Copy action XML. The self-service portal creates the new action XML segment and opens the Edit Actions form.
    3. In the Information section, in the Name box, type a new name for the action XML segment, and then click Save.
    4. In the CreateVM section, use the following steps to create the custom virtual machine properties RAM and CPU Count.
         a. Click Add Custom Virtual Machine Property.
         b. In the Add Custom Virtual Machine Property dialog box, define a property named RAM. Give the details like Key, Display Name, Description and Default Value.
        c. When finished, click Save to close the dialog box.
        d. Repeat steps a-c to define a property named CPUCount.
            The Edit Action form lists both new properties in the CreateVMsection.
    5. In the Tasks pane of the Edit Action form, click Save to save the new custom properties.
    6. In the CreateVM section, next to CreateVMTask, click Edit to open the Edit Task for Action form.
    7. Add the new custom properties as input parameters for the script, using the following steps:
         a. In the Edit Task for Action form, in the Input Parameter section, click Add Parameter.
         b. In the Add Parameter dialog box, in Key, type RAMInMB as the key name for the new parameter.
         c. Under Value, click Runtime Value, and then click DataItem to expand the list of available values.
         d. Click CustomVirtualMachineProperties, and then click RAMKey.
            This configuration sets the parameter value to the expression $DataItem/CustomVirtualMachineProperties/RAM$, which the script evaluates at run-time.
            When finished, click Save to return to the Edit Task for Action form.
          e. Repeat steps a-d to create another parameter, using the key name CPUCountKey and the runtime value    $DataItem/CustomVirtualMachineProperties/CPUCount$.
    8. In the Lock Script box, modify the lock script to use the new parameters.
          a. In the param statement, add $RAMKey and $CPUCountKey to the list of variables.
          b. Modify each of the three New-VM statements to add the switches –CPUCount $CPUCountKey and –MemoryMB $RAMKey.
    9. In the Tasks pane of the Edit Task for Action form, click Save and Close.
    10. In the Tasks pane of the Edit Action form, click Save and Close.

    To provision a service role to use the modified CreateVM action
    • When you provision a service role, in the Action XML section of the Edit Service Role form, select the custom action XML segment that you created previously in this example.
    For more information about provisioning service roles, see the topic “Provisioning a Requested Service Role or Service Role Change” in the Help or the Virtual Machine Manager Self-Service Portal 2.0 SP1: Datacenter Administration Guide.

    To create a virtual machine using the new custom properties
     1. When you create a virtual machine, in the Join Infrastructure section of the Create Virtual Machine wizard, verify that the selected service role is the service role you configured to use the custom action XML segment.
    The Create Virtual Machine wizard includes a new section, Custom Virtual Machine Properties, that includes the custom properties RAM and CPU Count and their default values.
    2. To use values other than the defaults, type new values for RAM and CPU Count.
    3. Finish configuring the new virtual machine normally. When you have finished the Create Virtual Machine form, click Create. For more information about creating virtual machines, see the topic “Creating Virtual Machines” in the Help or the Virtual Machine Manager Self-Service Portal 2.0 SP1: Datacenter Administration Guide.

    Thanks,
    Santosh

     

    • Proposed as answer by Santosh Karale Friday, July 15, 2011 7:01 PM
    • Marked as answer by ILeaveIT Sunday, July 17, 2011 11:49 AM
    Friday, July 15, 2011 7:00 PM