Azure Virtual Machine Management


Last modified: September 17, 2020

Overview

After you launch a virtual machine with cPanel & WHM on Azure®, you can manage it from the Azure portal. This document describes common tasks that your Azure virtual machine with cPanel & WHM may require.

Note:

For more information, read Azure’s Documentation.

Accessing your virtual machine

You can access your virtual machine, using one of the following options:

  • Click the message that appears on the deployment progress screen after your virtual machine deploys.

  • Enter Virtual Machines in the search bar at the top then selecting your machine.

  • From your Azure portal home page.

Logging in to WHM for the first time

Logging in to WHM for the first time differs based on your administrator account’s authentication method.

Using a password

If you use a password for your administrator account, you can log into WHM using your administrator username and password. In a web browser, connect to your virtual machine’s public IP address using HTTPS on port 2087. For example: https://192.0.2.0:2087. The cPanel & WHM installation process creates a limited version of a reseller account using that username and password.

If you need to access your virtual machine’s root account, log in to WHM then use WHM’s Change Root Password interface (WHM >> Server Configuration >> Change Root Password).

Using an SSH key

If you use an SSH key rather than a password, you must perform the following extra steps before you can log in to WHM for the first time:

  1. If using a new key pair, add your key to your computer.

    Note:

    If you did not download your key while launching your virtual machine, you can access it from Azure’s Resource groups interface. Click the name of your virtual machine’s resource group then the name of the key.

    On an MacOS™ computer that uses the default download folder:

    1. Run the following command, where example represents the key pair’s name:

      mv ~/Downloads/example.pem ~/.ssh
      
    2. Run the following command to modify the permissions for the .pem file, where example represents the key pair’s name:

      chmod 600 ~/.ssh/example.pem
      
    3. Run the following command to add the key pair, where example represents the key pair’s name:

      ssh-add ~/.ssh/example.pem
      

      An Identity added message will appear.

    On a Windows™ computer that runs the PuTTY client and uses the default download folder, perform the following steps:

    1. From the Windows Start menu, open PuttyGen.

    2. Under the Conversions heading, click Import.

    3. Navigate to the PuTTY Key Generator interface and select the .pem key you downloaded. Click Open.

    4. Enter a passphrase in the Key passphrase and Confirm passphrase text boxes.

    5. Click Save private key and save the key as a .ppk file.

    6. From the Windows Start menu, open PuTTY.

    7. In the Session interface, enter the following information:

      • Hostname (or IP address) — You virtual machine’s IP address.
      • Port — Enter 22.
      • Connection type — Select SSH.
      • Saved sessions — Enter a name for your session. Then click Save.
    8. Navigate to the Auth interface under the SSH category.

    9. Click Browse, select the .ppk file you created, and click Open.

  2. After completing the installation of WHM on your virtual machine, log in as your virtual machine’s administrator user over SSH. Use the following command, where key represents the file path of your SSH key, user represents the user you created with your virtual machine and IP represents your virtual machine’s IP address:

    ssh -i key user@IP
    
  3. To get a temporary WHM login URL, run the following command:

    sudo whmlogin
    
  4. Use that login URL to add a password to the root user.

Manage virtual machines

To manage an Azure virtual machine, perform the following steps:

  1. Access your virtual machine from your Azure portal.

  2. Select the desired action from the menu bar below your virtual machine’s name:

    • Connect — This action will help you connect your virtual machine with SSH clients.

      Warning:

      While Remote Desktop Protocols (RDP) and Azure’s Bastion service are listed as other options, these do not work with cPanel & WHM.

    • Start — This action will start a stopped virtual machine. This is not available for virtual machines that are already running.

    • Restart — This action will restart the instance. This is not available for stopped virtual machines.

      • You will be asked to confirm you want to restart your virtual machine.
      • Click Yes.
      • A progress message will appear. It will inform you when your virtual machine finishes restarting.
    • Stop — This action will stop your virtual machine.

      • You will be asked if you want to reserve the public IP address your machine is currently using.
        Warning:

        Your cPanel & WHM license is tied to your IP address. You must select this to avoid issues when restarting your instance.

      • You will be asked to confirm you want to stop your virtual machine.
      • Click OK.
      • If you selected to save the public IP address, a progress message confirming that will appear.
      • A progress message confirming your virtual machine is stopped will appear.
    • Capture — This action will create an image based on your virtual machine.

      Warning:

      We strongly recommend you do not capture images of your cPanel & WHM virtual machines. Capturing images can result in privacy and data issues for you and your users.

    • Delete — This action will delete the virtual machine.

      Warning:

      This will only delete the virtual machine. This will not delete any of the resources associated with the virtual machine. Read the Delete a virtual machine section below for more information.

    • Refresh — This action refreshes the page you are currently on. This is useful after you stop or restart your virtual machine as the menu might not automatically update.

    • Share to mobile — This action will provide you with a QR code and a direct link to the Azure interface of your virtual machine.

Delete a virtual machine or resource group

Important:

Azure will bill you for all active resources on your account. We recommend that you delete unused resource groups rather than only deleting unused virtual machines.

Running a virtual machine on Azure requires more resources than the virtual machine itself. These resources are grouped together in a resource group. If you only delete the virtual machine, the other resources will remain. If no other virtual machines are using the same resource group, we recommend deleting not only the virtual machine but the entire resource group.

It may take a few minutes for a deleted virtual machine or resource group to disappear from the Azure interface.

Delete a resource group

To delete a resource group, perform the following steps:

  1. On your Azure portal home page under Azure services, click Resource groups.

  2. The Resource groups interface will appear and will list all resource groups on your account.

  3. Click the name of the resource group you want to delete.

  4. On the horizontal menu under your resource group’s name, click Delete resource group.

  5. A warning will appear asking you to enter the resource group’s name to confirm you want to delete it. It will also list all the resources in the group that will be deleted.

  6. Enter your resource group’s name in the box.

  7. Click Delete.

Delete a virtual machine

To delete only a virtual machine, perform the following steps:

  1. Access your virtual machine from your Azure portal.

  2. Click Delete on the menu bar below your virtual machine’s name.

  3. A message will warn you that your virtual machine will be permanently deleted. It will also tell you that the associated resources will not be deleted.

  4. Click Yes.

  5. A progress message will appear. It will inform you when your virtual machine is deleted.

Additional Documentation