8. Creating and Populating Remote PC Pools¶
After setting up Parallels RAS, you can proceed to create remote PC pools as described in the Parallels documentation.
Having created the pools, you will need to populate them with virtual machines. For this you will need need a cloudbase image tailored for your VDI scenario. You can create it as described in the Virtuozzo Hybrid Infrastructure Administrator’s Guide. You will need to:
- Optimize the system for better performance. For example, with this optimization tool.
- Install Virtuozzo guest tools. See the Virtuozzo Hybrid Infrastructure Administrator’s Guide.
- Install user applications.
- Optimize security settings.
- Optionally install FSlogix tools to enable random desktops.
While you can create the VMs manually, it is simpler to populate a remote PC pool using the following scripts. Run them inside the Windows VM where you have installed Parallels RAS.
Download the scripts:
# wget https://docs.virtuozzo.com/files/vhw-remote-pc-pool-scripts.tar.gz
# tar -xzvf vhw-remote-pc-pool-scripts.tar.gz
The scripts are:
- New-VDIGuestFromVHI.ps1
- A PowerShell script that creates virtual machines in Virtuozzo Hybrid Infrastructure and adds them to the specified Parallels RAS remote PC pool.
- Remove-VDIGuestFromVHI.ps1
- A PowerShell script that removes virtual machines from the specified Parallels RAS remote PC pool and deletes them in Virtuozzo Hybrid Infrastructure.
Other scripts in the downloaded archive are used by these two.
Before you can use the scripts, prepare the system as follows:
Download and install the latest Python 2 release from the Python website. Add the installation directory to the
PATH
variable.Verify that
PATH
containsC:\Python27;C:\Python27\Scripts
:> echo %PATH%
Install
python-openstackclient
. From the command prompt, run:> easy_install pip > pip install python-openstackclient
If you get an error that Microsoft Visual C++ Compiler for Python 2.7 is missing, download and install it. If you get an error “The system administrator has set policies to prevent this installation”, run the command prompt as administrator and install the compiler as follows:
> msiexec /i VCForPython27.msi
Install
python-heatclient
:> pip install python-heatclient
Replace the line
import queue
withimport Queue as queue
inC:\Python27\Lib\site-packages\openstack\cloud\openstackcloud.py:import queue C:\Python27\Lib\site-packages\openstack\utils.py:import queue
On the Virtuozzo Hybrid Infrastructure node with the Parallels RAS VM, create a
provider-openrc.sh
script for the Virtuozzo Hybrid Infrastructure domain and project where you will create remote desktop VMs. For more details, see the Virtuozzo Hybrid Infrastructure Administrator’s Command Line Guide.
To populate a remote PC pool with VMs, use New-VDIGuestFromVHI.ps1:
Parameter | Description |
---|---|
OpenRC | The tenant’s OpenRC file. |
Insecure | Skip certificate verification. |
ImageName | The name of the image to create VMs from. |
VmNameTemplate | VM naming template. |
Count | The amount of Virtual Machines to create. |
Flavor | VM flavor. |
StoragePolicy | The storage policy to use for VMs. If not specified, the “default” storage policy is used. |
Network | The network to connect VMs to. |
PoolName | The name of the remote PC pool to add VMs to. |
ADDomain | The Active Directory Domain to add VMs to. |
ADUsername | The Active Directory Domain Administrator username. |
ADPassword | The Active Directory Domain Administrator password. |
OUPath | The path to the Organizational Unit. |
ProviderName | The name of the VDI provider in Parallels RAS. |
For example:
> New-VDIGuestFromVHI.ps1 -OpenRC admin-openrc.sh -ImageName `
Windows-2k19-clb-RAS -VmNameTemplate 'new-w2019-v1' -Count 2 `
-Flavor medium -Network VDINetwork -ADDomain abc.local -ADUsername Administrator `
-PoolName TestPool -Insecure -StoragePolicy Premium-SSD-3R `
-OUPath 'OU=RemotePC,OU=RAS,DC=abc,DC=local' -ProviderName abc-farm-pa-dc0.abc.local
To remove VMs from a remote PC pool and delete them from Virtuozzo Hybrid Infrastructure, use Remove-VDIGuestFromVHI.ps1:
Parameter | Description |
---|---|
OpenRC | The tenant’s OpenRC file. |
Insecure | Skip certificate verification. |
VmNameTemplate | VM naming template. |
PoolName | The name of the remote PC pool to remove VMs from. |
ADUsername | The Active Directory Domain Administrator username. |
ADPassword | The Active Directory Domain Administrator password. |
For example:
> Remove-VDIGuestFromVHI.ps1 -OpenRC admin-openrc.sh -VmNameTemplate `
'new-w2019-v1' -ADUsername Administrator -PoolName TestPool -Insecure `
-ProviderName abc-farm-pa-dc0.abc.local