Managing the VM Lifecycle

This chapter contains the following sections:

Managing the VM Lifecycle

You can perform post-provisioning lifecycle management actions on virtual machines (VMs).

These actions are broadly classified into four categories:

  • VM power management—Power on, power off, pause, resume, shutdown guest, standby, reset, and reboot a VM.

  • VM resizing—Resize a VM and resize a VM disk.

  • VM snapshot management—Create a snapshot, revert a snapshot, mark a snapshot as golden, delete a snapshot, and delete all snapshots.

  • Other VM actions—Create a VM disk, delete a VM disk, repair a VM, add a vNIC, delete a vNIC, save the state of a VM, discard the saved state of a VM, view the VM details, stack view of a VM, assign a VM, assign VM credentials, launch a VM client, and request for inventory collection.


    Step 1   Choose Virtual > Compute.
    Step 2   Expand All Clouds and choose an SCVMM cloud.
    Step 3   Click VMs.
    Step 4   Click the row with the VM that you want to manage and click one of the following options:

    Some of these options are available only from the More Actions drop-down list.

    • View Details
    • Manage Tags
    • Add Tags
    • Delete Tags
    • Assign VM
    • Configure Lease Time
    • Stack View
    • Access VM Credentials
    • Launch VM Client
    • Power OFF
    • Pause
    • Create Snapshot
    • Inventory Collection Request for VM
    • Save State
    • Reset
    • Shutdown Guest
    • Clone
    • Delete Snapshot
    • Delete All Snapshots
    • Mark Golden Snapshot
    • Revert Snapshot
    • Resize VM
    • Power ON

    You can also click Stack View, and View Details to access trend reports and details about service requests, VM action requests, events, VM snapshots, vNICs, disks, and linked clone VMs.


    Managing VM Power

    You can manage the power functions on VM that includes actions such as power on, power off, suspend power, reset, or reboot the VM.


      Step 1   Choose Virtual > Compute.
      Step 2   Expand All Clouds and choose an SCVMM cloud.
      Step 3   Click VMs.
      Step 4   From the drop-down icon at the top right corner of the VMs table, choose an action.

      The following actions appear according to the power state of the VM.

      Action Description

      Power On

      Powers on the VM.

      Power Off

      Power off the VM.

      Suspend

      Places the VM in a suspended state.

      Shutdown Guest

      Shuts down the Guest OS on the VM.

      Reset

      Performs a hard reset of the VM.

      Step 5   On the VM Task screen, choose an action and complete the following fields:
      Name Description

      VM Name field

      Displays the name of the VM selected.

      Task field

      Displays the selected power management task.

      Comments field

      Enter comments if necessary.

      Schedule Action radio button

      Click one of the following options:

      • Execute Now—Applies the action on the VM immediately.

      • Execute Later—Applies the action on the VM at the specified date and time.

      Step 6   Click Proceed.

      VM Memory

      You can configure the VM memory to one of the following:

      Static Memory

      Static memory allows you to allocate a fixed amount of memory to the VM.

      SCVMM 2016 supports changing the static memory of a VM when it is in Power On state. This feature is also known as Hot Add. It allows you to resize the VM memory without incurring any downtime as you can make the change while the VM is running.

      Dynamic Memory

      Dynamic memory allows you to specify a range and a buffer percentage from the resource pool. This feature dynamically adjusts the amount of memory allocated to the VM, in response to changes in the amount of memory required by the workloads or applications running in the virtual machine.

      Microsoft SCVMM 2012 and 2016 support Hot add/remove of dynamic memory, also known as Runtime Memory Resize. With hot add/remove, a VM can have its memory resource changed to a specific value even when the VM is in Power On state. This works for both generation 1 and generation 2 virtual machines, running Windows Server 2012, Windows Server 2016, or Windows 10.

      In addition, Memory Weight is introduced as a parameter while provisioning a VM. Almost any host server has some VMs that are more important than others. Hyper-V lets you prioritize them so that memory is allocated to the higher priority VMs first during a physical memory shortage. You can prioritize a VM’s need for dynamic memory by adjusting its memory weight. VMs with a higher memory weight take precedence over VMs with lower memory weights. The memory values can range from 0 to 10000 (both included), with 10000 being the higher precedence.

      Resizing Memory and CPU for a VM

      Before You Begin

      Make sure that you have a Windows 10, Windows Server 2012, or Windows Server 2016 running.

      During resizing of memory:


        Step 1   Choose Virtual > Compute.
        Step 2   Expand All Clouds and choose an SCVMM cloud.
        Step 3   Click VMs.
        Step 4   Choose the VM that you want to resize.
        Step 5   From the More Actions drop-down list, choose Resize VM.

        If the Resize VM option is not in the list, see Enabling the Resize VM Feature.

        Step 6   On the Resize VM screen, complete the following fields:
        Name Description

        VM Name

        Displays the name of the VM.

        Current Allocated CPU

        Displays the current CPU on the VM.

        Dynamic Memory

        If status is:

        • Disabled—VM uses Static memory.

        • Enabled—VM uses Dynamic Memory.

        Current Allocated Memory (GB)

        Displays the current memory on the VM.

        Current Allocated Memory Weight

        Displays the memory weight allocated to the VM.

        New CPU Count

        Select the new CPU count from the drop-down list.

        This field cannot be changed when the VM is in the On state.

        Static Memory — Changing the static memory of a VM when it is powered on is supported only in SCVMM 2016.

        New Memory

        Choose the new memory allocation for the VM.

        This field is not available on Windows Server 2012 unless the VM is powered off.

        New Memory Weight

        Enter a value between 0 to 10000. Zero is the lowest precedence and 10000 is the highest.

        A lower value for this VM prevents it from starting when other VMs are running and available memory is low.

        This field cannot be changed when the VM is in the On state.

        Dynamic Memory — To change from Static to Dynamic memory, you must first power off the VM. When you check Enable Dynamic Memory, the next three fields appear.

        New Startup Memory

        Choose the amount of memory required to start the virtual machine.

        This field cannot be changed if the VM is in theOn state.

        New Maximum Memory (MB)

        Choose the maximum amount of memory that the VM is allowed to use. The value can be as low as the value for Startup Memory to as high as one TB. However, a virtual machine can use only as much memory as the maximum amount supported by the guest operating system.

        New Memory Buffer(%)

        Choose the memory buffer allocation, specified as a percentage of New Maximum Memory.

        This is the memory Hyper-V attempts to assign to the VM, compared to the amount of memory needed by the applications and services running inside it.

        New Memory Weight

        Enter a value between 0 to 10000. Zero is the lowest precedence and 10000 is the highest.

        A lower value for this VM prevents it from starting when other VMs are running and available memory is low.

        Current CPU Cost (currency: USD)

        CPU cost per hour.

        This cost is calculated automatically and is based on CPU charge per unit (GHz/Core). This field is display only.

        Current Memory Cost (currency: USD)

        Memory cost per hour.

        This cost is calculated automatically and is based on maximum memory being used. This field is display only.

        New CPU Cost (currency: USD)

        CPU cost per hour.

        This cost is calculated automatically and is based on CPU charge pre unit (GHz/Core). This field is display only.

        New Memory Cost (currency: USD)

        Displays the updated memory cost per hour when dynamic memory is enabled.

        Click Compute New Memory Cost to update the memory cost based on the changes made earlier.

        This field is display only.

        Step 7   Click Resize.

        Enabling the Resize VM Feature


          Step 1   Choose Policies > Virtual/Hypervisor Policies > Computing.
          Step 2   On the Computing page, click HyperV Computing Policy.
          Step 3   Choose the VM you want to edit.
          Step 4   Click Edit.
          Note   

          The VM must be powered off before you proceed further.

          Step 5   On the Modify Policy screen, under Resizing Options, check Allow Resizing of VM.
          Step 6   Click Submit.

          Resizing a VM Disk


            Step 1   Choose Virtual > Compute.
            Step 2   Expand All Clouds and choose an SCVMM cloud.
            Step 3   Click VMs.
            Step 4   Choose the VM that you want to resize.
            Note   

            The VM must be in the power off status. If the VM is in the on status, turn off the power of the VM using the Power Off action.

            Step 5   From the More Actions drop-down list, choose VM Disk Resize.
            Step 6   In the Resize VM Disk dialog box, complete the following fields:
            Name Description

            VM Name field

            The name of the VM.

            Select Disk drop-down list

            Choose the disk to resize.

            Total Provisioned (GB) field

            The total provisioned disk size in gigabytes.

            New Size(GB) field

            The new disk size in gigabytes.

            Step 7   Click Resize.

            Managing VM Snapshots

            You can do the following VM snapshot actions:
            • Create a snapshot

            • Revert a snapshot

            • Delete a snapshot

            • Delete all snapshots

            • Mark a snapshot as golden


            Note


            You can manage the snapshot of the VM that is in the power on state.


            For a selected VM on the VMs screen, choose the following actions from the More Actions drop-down list:
            Name Description

            Create Snapshot

            Creates a snapshot with a name and description.

            Revert Snapshot

            Reverts back to the most recent snapshot of a VM, thereby bringing the VM back on line.

            If the VM crashes or malfunctions, you can revert back to the most recent snapshot. You can also select a specific snapshot to revert back to, if there is more than one snapshot.

            Mark Golden

            Marks a snapshot as golden.

            Marking a snapshot as golden prevents it from being accidentally deleted. The only way to delete a golden snapshot is to unmark the golden snapshot (returning it to a standard snapshot).

            Delete Snapshot

            Deletes a snapshot.

            Delete all Snapshots

            Deletes all snapshots for this VM.

            You can delete all of your snapshots unless a golden snapshot is present. You have to unmark the golden snapshot first before being able to delete all of your snapshots.

            Creating a VM Snapshot

            You can create a snapshot of a VM at any point in time. You can later choose to revert to this snapshot or delete it.


              Step 1   Choose Virtual > Compute.
              Step 2   Expand All Clouds and choose an SCVMM cloud.
              Step 3   Click VMs.
              Step 4   From the More Actions drop-down list, choose Create Snapshot.
              Step 5   On the Create Virtual Machine Snapshot screen, complete the following fields:
              Name Description

              Snapshot Name field

              Name for the VM snapshot.

              Snapshot Description field

              Description of the VM snapshot.

              Step 6   Click Proceed.

              Marking a Snapshot as Golden

              You can mark a snapshot as golden to prevent it from being accidentally deleted. The only way to delete a golden snapshot is to unmark the golden snapshot (returning it to a standard snapshot).


                Step 1   Choose Virtual > Compute.
                Step 2   Expand All Clouds and choose an SCVMM cloud.
                Step 3   Click VMs.
                Step 4   From the More Actions drop-down list, choose Mark Golden Snapshot.
                Step 5   On the Mark Golden Snapshot screen, complete the following fields:
                Name Description

                Snapshot table

                Choose a snapshot from the list of snapshots created for the VM.

                Mark As Golden Snapshot check box

                Check this check box to designate the snapshot as a golden snapshot.

                Step 6   Click Proceed.

                Adding a VM NIC

                Before You Begin

                Ensure that a network policy is assigned to the VM network. Turn off the power on the VM if the SCVMM version is 2012 or older.


                  Step 1   Choose Virtual > Compute.
                  Step 2   Expand All Clouds and choose an SCVMM cloud.
                  Step 3   Click the VMs tab.
                  Step 4   Choose a VM to configure with NIC.
                  Step 5   From the More Actions drop-down list, choose Add NICs.
                  Step 6   On the Add VM NICs screen, complete the following fields:

                  Name

                  Description

                  Adapter Type drop-down list.

                  By default, this is set as SYNTHETIC type.

                  Choose Synthetic or Emulated. The network adapters are used to connect the virtual machines to internal networks, or to external networks after the virtual machines are deployed on a host. Synthetic network adapters provide better performance than emulated network adapters. Emulated network adapters are available on all virtualization software platforms and allow virtual machines to be connected to virtual networks.

                  Enable MAC Spoofing check box

                  Check the box to enable MAC spoofing.

                  VM Networks field

                  Click the + icon to select a network to which you are adding the VM NIC.

                  Note   

                  An error message appears if the VM is not part of a network policy.

                  Subnet field

                  Click the + icon to select a Subnet to which you are adding the VM NIC.

                  Use DHCP check box

                  By default, the box is checked because when we add a NIC to the VM, the IP address are not assigned from a static IP pool. This is due to limitations within the SCVMM.

                  Port Classification drop-down list

                  (Optional) Choose a port classification from the list.

                  Provides global names used to identify different types of virtual network adapter port profiles. The port classification settings remain specific to each logical switch, even if they can be used across multiple logical switches.

                  Step 7   Click Submit.

                  Assigning a VM

                  You can assign a VM to a group or vDC, and modify the VM category if needed. The provisioning time, termination time, and VM label can also be assigned.


                    Step 1   Choose Virtual > Compute.
                    Step 2   On Compute page, choose an SCVMM cloud.
                    Step 3   Click the VMs.
                    Step 4   Click the row with the VM that you want to assign to a group.
                    Step 5   From the More Actions drop-down list, choose Assign VM.
                    Step 6   In the Assign VM screen, complete the following fields:
                    Name Description

                    VM Name field

                    The name of the VM (non-editable).

                    VM Ownership field

                    Choose a Group or a single User to assign the VM.

                    User Group field

                    This field appears when you select Group under VM Ownership. Choose a user group from the list.

                    Click Validate to confirm the user group.

                    Note   

                    Only the groups with valid vDC can be selected.

                    User field

                    This field appears when you select User under VM Ownership. Choose a user from the list.

                    Note   

                    The user list appears only when the group allows resource assignment for users.

                    vDC drop-down list

                    Choose a virtual data center (vDC).

                    Category drop-down list

                    Choose a category of the VM.

                    VM User Label field

                    VM user label, if necessary.

                    Set Provision Time check box

                    Check this check box if you want to set the provisioning time.

                    If checked, continue to Step 6.

                    Provision Date/Time field

                    Set the date and time to provision the VM.

                    Comments field

                    Enter the comments.

                    Step 7   Click Assign.

                    Creating a VM Disk

                    You can create a new VM disk for a selected VM. The disk can be either new, or created from an existing hard disk in the library.


                    Note


                    This option is available only when the VM is in Power Off state.



                      Step 1   Choose Virtual > Compute.
                      Step 2   Expand All Clouds and choose an SCVMM cloud.
                      Step 3   Click VMs.
                      Step 4   Click the row to select a VM for which you want to create a new disk.
                      Step 5   From the More Actions drop-down list, choose Create VM Disk.
                      Step 6   On the Create VM Disk screen, complete the following fields:
                      Name Description

                      VM Name field

                      The name of the VM (non-editable).

                      Enter Disk Name field

                      The name of the disk.

                      Disk drop-down list

                      You can choose between the following:

                      • Create a new virtual hard disk

                      • Use an existing virtual hard disk

                      Select SCSI Controller drop-down list

                      Choose a channel and logical unit number (LUN) to which you want to add the disk.

                      Choose Hard Disk field

                      This field appears when you choose to use an existing virtual hard disk. Choose a hard disk from which you want to create a VM disk.

                      Click Validate and click Compute New Disk Cost.

                      Select disk typedrop-down list

                      This field appears when you choose to create a new virtual hard disk. Choose Dynamic or Fixed as the disk type.

                      Disk Size (GB) field

                      The size of disk in gigabytes. Maximum size can be up to 2TB.

                      This field appears when you choose to create a new virtual hard disk.

                      Click Compute New Disk Cost.

                      Step 7   Click Create.

                      Cloning a VM

                      Cloning a VM makes a copy of an existing VM in order to make a new VM with similar qualities. Cloning saves you time by keeping the parameters that you want from the VM that you are cloning. The new name given to the clone is defined in the system policy.


                        Step 1   Choose Virtual > Compute.
                        Step 2   Expand All Clouds and choose an SCVMM cloud.
                        Step 3   Click VMs.
                        Step 4   Click the row with the VM that you want to clone.
                        Step 5   From the More Actions drop-down list, choose Clone.
                        Step 6   On the Clone VM screen, select the group on which you want the VM deployed from the Select Groups field.
                        Step 7   Click Validate.
                        Step 8   Click Next.
                        Step 9   On the Customization Options screen, complete the following fields:
                        Name Description

                        Category field

                        Click Select to view a list of VDC categories.

                        Select a category and click Select.

                        Post Provisioning Customs Actions check box

                        Click Enable to attach a workflow. The Workflow drop-down list appears with a list of work flows to choose from. The chosen workflow initiates when the provisioning starts.

                        VM App Charge Frequency drop-down list

                        Choose Hourly or Monthly.

                        Active VM Application Cost field

                        The cost for the application that is included in the template.

                        Inactive VM Application Cost field

                        The cost to this catalog of a VM in inactive state per hour or month.

                        Step 10   Click Next.
                        Step 11   On the Deployment Configuration screen, complete the following fields:
                        Name Description

                        Select VDC drop-down list

                        Choose a VDC containing the policies you want for the VM.

                        VM Name or VM Prefix field

                        The VM name or prefix.

                        Comment field

                        Optionally, enter a description of the VDC.

                        Provision drop-down list

                        Choose Now to provision the VDC now or choose Later to provision the VDC at a later time.

                        If you choose Later, then fields to specify the date and time appear.

                        Lease Time check box

                        Check the check box to configure a lease expiration time.

                        Step 12   Click Next.
                        Step 13   On the Custom Specification screen, complete the following fields:
                        Name Description

                        CPU Cores drop-down list

                        Choose the CPU cores for the VM being provisioned.

                        Enable Dynamic Memory check box

                        Check to provision the VM with dynamically allocated memory. You can specify custom memory parameters in the Startup Memory, Maximum Memory, and Memory Buffer, drop-down lists.

                        Memory drop-down list

                        Choose the amount of memory for the VM being provisioned.

                        MemoryWeight drop-down list

                        Specify how to prioritize the availability of memory for this VM compared to other VMs on this computer.

                        Step 14   Click Next.
                        Step 15   On the Custom Workflow screen, if applicable, complete the required fields.
                        Note   

                        Custom workflow inputs apply if the catalog chosen for VM provisioning has Post Provisioning Custom Actions enabled.

                        Step 16   Click Next.
                        Step 17   On the Select VM Networks screen, if applicable, click the VM Networks pencil icon to edit a VM network.
                        Note   

                        The Select VM Networks screen is empty unless the Allow end user to select optional NICs check box is chosen in the network policy.

                        Step 18   On the Select screen, choose one or more clouds that you want associated with the VM.
                        Step 19   Click Submit.
                        Step 20   If you checked the Perform deployment assessment check box, then review the report of the assessment displayed in the Deployment Assessment pane.

                        If this assessment report identifies errors, then return to the previous panes and rectify the errors before submitting the request. If the assessment report shows no errors, then click Next.

                        Step 21   On the Select Datastores screen, if applicable, click Select in the Select Datastore field to select one or more datastores to associate with the VM.
                        Note   

                        This option is only available if Allow user to select datastore from scope is checked in the storage policy. The datastore choices that are available depend upon the storage policy that is associated to the VM's VDC.

                        Step 22   Click Next.
                        Step 23   Review the cloned VM information in the Summary panel.
                        Step 24   Click Submit.

                        Managing vNICs

                        SCVMM 2016 introduces Hot Add vNIC feature. It allows you to add/edit/delete of NICs even when the VM is in running state.

                        You can add a NIC to a VM, as well as edit, replace, and delete a NIC. The network policy that is mapped to the vDC determines the available options for a NIC.

                        However, this feature is not supported if the guest OS is running a pre Windows 10 version or CentOS operating system.


                        Note


                        The VM must be powered off to perform NIC actions if the SCVMM version is 2012 or older. If the VM is in the on state, turn off the power of the selected VM using the Power Off action.


                        Adding a VM NIC

                        Before You Begin

                        Ensure that the VM is powered off to perform VM NICs actions. If the VM is in the on state, turn off the power of the VM using the Power Off action.


                          Step 1   Choose Virtual > Compute.
                          Step 2   Expand All Clouds and choose an SCVMM cloud.
                          Step 3   Click VMs.
                          Step 4   Click the row with the VM to which you want to add a VM NIC.
                          Step 5   From the More Actions drop-down list, choose Add NIC.
                          Step 6   In the Add VM NIC screen, complete the following fields:
                          Name Description

                          Adapter Type drop-down list

                          Choose Synthetic or Emulated. The network adapters are used to connect the virtual machines to internal networks, or to external networks after the virtual machines are deployed on a host. Synthetic network adapters provide better performance than emulated network adapters. Emulated network adapters are available on all virtualization software platforms and allow virtual machines to be connected to virtual networks.

                          VM Network table

                          Network to which you are adding the VM NIC.

                          Subnet field

                          Subnet to which you are adding the VM NIC.

                          Use DHCP check box

                          By default, DHCP is enabled. Uncheck to disable DHCP.

                          Port Classification field

                          Provides global names used to identify different types of virtual network adapter port profiles. The port classification settings remain specific to each logical switch, even if they can be used across multiple logical switches.

                          Step 7   Click Submit.
                          Step 8   Click OK.

                          Editing a VM NIC

                          Before You BeginEnsure that the VM is powered off to perform VM NICs actions if the SCVMM version is 2012 or older. If the VM is in the on state, turn off the power of the VM using the Power Off action.

                            Step 1   Choose Virtual > Compute.
                            Step 2   Expand All Clouds and choose an SCVMM cloud.
                            Step 3   Click VMs.
                            Step 4   Click the row with the VM that you want to configure.
                            Step 5   From the More Actions drop-down list, choose Edit NIC.
                            Step 6   In the Edit VM NIC screen, make the necessary changes.
                            Step 7   Click Submit.
                            Step 8   Click OK.