Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Adding an already running VM in Virtual Machine Manager to a Widows Azure Pack S  (Read 10255 times)

0 Members and 1 Guest are viewing this topic.

sajugovind

  • Guest

To add an already running VM to a WAP subscription do the following:

    1. Log in into the WAP tenant portal with the credentials of a tenant administrator that has an active subscription. (e.g. admin@contoso.com)
    2. Select VM Clouds and verify that the VM(s) you want to move are not already showing and that minimum one VM is running under the subscription.

    We are using the running VM to make sure we extract the right information to move the two VMs to the subscription.

    3. Close the WAP Tenant Console.
    4. Open the WAP Admin Portal and login as an administrator.
    5. Select Plans.
    6. Select the plan that the VMs should be added to. (e.g. Contoso).
    7. Select Virtual Machine Cloud.

    Note the VMM Management Server and Virtual Machine Cloud for the VM Cloud Plan as we will use this later. (e.g. vmm01.contoso.com and Contoso).

    8. Click the "back arrow" to get back to Plans.
    9. Select Subscriptions.
    10.Notice the user for the subscription, as we will use this later (e.g.: User: admin@contoso.com).
    11.Login to the WMM Server as VMM Administrator.
    12.Start the VMM Console.
    13.Select VMs and Services.
    14.Select Clouds.
    15.Select the Cloud for which the WAP VM Cloud Plan is mapped (e.g. Contoso).
    16.Right Click on a Virtual Machine which was showing in the WAP Tenant Portal and select Properties.
    17.Select Access in the left menu
    18.Note the Self-service Owner (e.g. admin@contoso.com (admin@contoso.com_4afe55ef-c171-4b48-8a02-97aee2e7ed34))

    19.Click Ok to close the VM Properties.
    20.Click on All Hosts.
    21.In the search windows search for the VMs you would like to add to the WAP subscription (e.g. Contoso1).

    Note: In the list above, two VMs are showing that does not belong to a cloud. (Contoso101 and Contoso102).

     22.Right click on the first VM and select Properties (e.g. Contoso101).
     23.Under General select the Cloud (from the drop down) which the VM should belong to, according to the WAP Plan. (E.g. Contoso).
    24.Click OK.
    25.Do the same for the other VM (e.g. Contoso102).
    26.Click on the Cloud that the VMs were assigned to under Clouds and verify that the VMs have been added.
    27.Open a VMM PowerShell windows from the start menu.
    28.Connect to VMM Server by using the ForOnBehalfOf parameter in VMM, this will allow you to make use of tenant users in VMM and setting the owner for a VM, for a user which is not in AD.
    Run the following command:

    $SCVMMSERVER = Get-SCVMMServer -ComputerName vmm01.contoso.com -ForOnBehalfOf

     
    We want to take the following properties from the already running VM in the cloud and save them to the following variables:

    Owner

    User Role

     
    29.Run the following command to extract the needed information from the VM which is already running under the WAP Tenant Subscription (e.g. Contoso01):

    get-vm -name contoso01 |ft name, selfserviceuserrole, owner

     30.Set the variables for the VMs, where Contoso01 is the VM currently running in the WAP Tenant Portal and Contoso101 is the VM we would like to move to the WAP Subscription.

    $vmnamesource = "contoso01"

    $vmnametarget = "contoso101"

    $vminfo = Get-SCVirtualMachine -name $vmnamesource

    $vmowner = $vminfo.owner

    $vmselfserviceuserrole = $vminfo.selfserviceuserrole

     
    31.Set the Owner and the self-service user for the VM by running the following command:

    Set-SCVirtualMachine –VM $vmnametarget –UserRole $vmselfserviceuserrole –Owner $vmowner
       
    32.Verify the result in VMM.

    33.To move Contoso102 VM to the Contoso subscription just set the $vmnametarget variable to contoso102 and run the command again.

    $vmnametarget = "contoso102"

    Set-SCVirtualMachine –VM $vmnametarget –UserRole $vmselfserviceuserrole –Owner $vmowner
         
    34.Open the WAP Tenant Portal.
    35.Login in as the subscription admin (e.g. admin@contoso.com).
    36.Select Virtual Machines.
    37.Verify that the two new VMs shows in the list of VMs.
    38.Click Start and verify that the VM performs the action
    39.In the VMM Console verify that the two VMs are in fact running.

 
Adding a co-administrator to a subscription

The second part of the scenario is to add a co-administrator the Contoso subscription, so this user also can access the cloud resources under the Contoso subscription. To do this perform the following steps:

    1.Login to the WAP Tenant Portal as the Subscription owner of a plan.
    2.Click My Account.
    3.Click Administrators.
    4.Click Add from the bottom menu.
    5.Write the e-mail of the user you would like to be a co-administrator (e.g. john@contoso.com).
    6.Select the Subscription(s) that you would like the co-administrator to have access to.
    7.Click OK.
    8.Verify that the new user shows in the list.
    9.Sign Out from the tenant portal.
    10.Click Sign in back to Service Management Portal.
    11.Select
    12.Provide the user name created earlier (e.g. john@contoso.com).
    13.Provide a password and click sign up.
    14.Complete the Welcome Screen wizard.
    15.Click Virtual Machines.
    16.Verify that you have the same list of VMs as the subscription owner.
    17.Close the WAP Tenant portal.