Course13:IT Plus- Setting up a virtual application platform on Hyper-V (VAP): Difference between revisions

From innovaphone wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{#moodlebook: Master Templates / V13 Templates / Advanced Pro |  Setting up a virtual application platform on Hyper-V (VAP)  | 132 }}
{{#moodlebook: Master Templates / V13 Templates / Plus |  Setting up a virtual application platform on Hyper-V (VAP)  | 132 }}

Revision as of 11:13, 2 August 2023

How to setup and run an AP on Hyper-V

The virtual Application Platform (AP)

When you look at the advanced UI of an IPVA, you will notice that there is no App-Platform tab. The reason is that you do not run the AP inside the IPVA. Instead, you would run the AP in an extra virtual machine on your hypervisor.

In other words, you would import a virtual machine template for the App Platform into the Hyper-V manager.

Here in the course, this template (like the template for the IPVA) is available in the Virtual Application Platform (VAP) section on the https://class.innovaphone.com/moodle2/mod/resource/icon.gif Recommended Tools for this Course page. It is called app-platform-Hyper-V.zip.

Please

In real life, you can download it from screenshot.png the App Platform tab of link_intern.png store.innovaphone.com: release/136116/download.htm. It is one of the 3 files downloaded when you click on the download symbol.

Creating the virtual machine

The process to create the virtual machine is pretty similar to the one we used to create the IPVA before.

To create the virtual machine based on the download template proceed as follows:
  • select screenshot.png Import virtual Machine ... from your host's context menu in Hyper-V Manager
  • select the screenshot.png app-platform-Hyper-V\Hyper-V\Virtual Machines folder (found in the unzipped app-platform-Hyper-V.zip) in the Locate Folder dialog
  • select screenshot.png app-platform in the Select Virtual Machine dialog
  • choose screenshot.png Copy the virtual machine in the Choose Import Type dialog
  • import the template (you can leave the Choose Destination and Choose Storage Folders unchanged, although you can of course also use different folders if you like)
    (Further Hints) Hyper-V may screenshot.png complain that the file to import is already there. In this case, this may be a leftover from a previously removed virtual machine which you can safely delete. Otherwise, you must use a different folder to store the .vhdx file
The screenshot.png new virtual machine's name is good as is (as you will rarely create multiple App Platforms in a single installation).

Adjusting the VAP's MAC address

Again, Hyper-V will create a dynamic (that is, random) MAC address to the virtual machine's network adapters. Also for the AP, in most cases, this is good enough. However, as you already know, we have pre-configured our IP411RIGHT as DHCP server with screenshot.png static address reservations for 4 virtual machines. For this to work, your App platform's network adapter needs to use the correct MAC address.

Those are the addresses you screenshot.png have defined in your https://class.innovaphone.com/moodle2/pix/f/web.gif Training Setup Device Definition for the App platforms:
  • IPVA1: 00-03-FF-07-1F-F1
  • IPVA2: 00-03-FF-07-1F-F2
  • IPVA3: 00-03-FF-07-1F-F3
  • APPPLATFORM2: 00-03-FF-07-1F-F4
As we want to run the App platform on a virtual machine in this lesson, use 00-03-FF-07-1F-F4 (APPPLATFORM2) as static address in the virtual machine's screenshot.png Settings ... / Hardware / Network adapter / Advanced Features dialog.

Setting the RAM size

By default, your new virtual AP will have a RAM size of 512 MB. This is a good trade-off between performance and memory usage for many cases.

However, you can modify this size (in the virtual machine's Settings / Memory RAM: setting). You can lower the RAM: size down to 256 MB. Of course you could also assign more RAM to your AP.

(Further Hints) We currently do not recommend to use Hyper-V's dynamic memory feature for the AP.

To make sure your training PC still runs smooth with both the IPVA and the AP:


Setting the disk size

When you look at the settings of your new virtual machine you will see that there is only a screenshot.png single hard drive (IDE 0:0) with a maximum size of 16GB configured.

This disk drive has a small partition which is used to boot a Linux installer when you power up the virtual machine for the first time.

During the first boot, this installer will determine the maximum size of the IDE 0:0 drive and will create a new partition using the remainder of the disk. This partition will then carry the file systems used by the Application platform.

(Further Hints) When you install a new virtual application platform, you can decide for and modify the size of its disk - but you must do it before the first boot.

Here in the training, we won't be using that much space, so you can shrink the disk as follows:
  • in the virtual machine's Settings ... select the hard drive connected to IDE controller 0 position 0
  • click on the Edit button
  • proceed to Choose Action and screenshot.png select Shrink

    (Further Hints) In real life, you will in many cases configure a larger disk instead of a smaller one. You would select Expand in this case

  • set New size: to the maximum disk size you want to allow for your AP (4 GB here in the course) in the Configure Disk dialog
  • and finish the dialog
(Further Hints) Note that the virtual disk file format (.vhdx) used by Hyper-V is dynamic. That is, the physical file used for the virtual disk won't have its full size initially. The file will grow however as soon as more disk space is used. This allows you to assign more virtual disk space than is physically available on the host to all your virtual machines (in the hope that not all will in fact use them).



Note that as mentioned above, this procedure only works before the first boot. But what if you run into a full disk after your AP ran for a while?

(Further Hints) Expanding a disk drive that has already been used is a bit more complicated. See chapter Resizing the disk of a Virtual_machine in fish-help.png Concept App Platform. Note that this will work for a VAP only (not for an AP running on a gateway platform).

Installing the Linux distribution

Your new virtual machine will boot up a Linux installer when it is powered on for the first time. The installer will create the partition and file systems for the AP and then boot the real kernel. This is why you have to modify the virtual machine disk size before you do the initial boot: the installer would take "whatever is there" and create a Linux file system partition in it.

To do the initial setup of the AP
  • start screenshot.png your AP in Hyper-V Manager
  • see the screenshot.png first boot
  • wait for the second boot until you screenshot.png see the

    starting manager
    OK


    message and the login prompt. The manager (in tandem with the web server) is the root service implementing the AP on the Linux operating system
You can now log in to the AP's underlying Linux operating system (if you feel like so) using the admin / ipapps credentials. Note that you are not root then: to change vital things, you need to use the www.png sudo command.

When you do so, the virtual machine will catch your cursor (so any input will be directed to the VM). To release the cursor (and return it back to your windows system), press CTRL-Alt-<left-arrow>.

Stopping the AP

As opposed to the IPVA, the virtuall AP can be shut down orderly using the screenshot.png Shut Down... menu entry in Hyper-V manager.

Basic course configurations

At this point, you must do some basic configurations so that your new App platform works well with moodle.

(Further Hints) But be sure you have already completed the Section test (Setting up a virtual appliance on Hyper-V (IPVA) before you proceed!

This is the section test related to the previous book and you should already have completed it anyway

The configuration steps are described in the fish-help.png How to setup the Application Platform after a factory reset book. As opposed to what is described in this book however, there is no start configuration you could load on to the App platform (we will use the Install in a minute to create the configuration). Also, you do not need to install the bare App platform (as it is already present in the virtual machine template you used).

So all you need to do is to access the AP manager (on https://172.31.31.11 with password pwd) and perform the steps described in these sections:
  • Setting the AP password, use ip411
  • Setting the App Store URL, it needs to be https://class.innovaphone.com/moodle2/webbuild/store.php/1-0/apps.json
  • Updating the core components using the App Store and
  • Making your AP known to moodle by setting Devices app URL 2 to wss://training-apps.training.innovaphone.com/class.net/Trainee-Devices/sysclients
(Further Hints) If your new AP does not respond on https://172.31.31.11 most probably the APPPLATFORM2's MAC address is wrong in your Training Setup Device Definition (or it was wrong when your IP411RIGHT was configured). In this case, fix the definition and also the DHCP reservations in IP411RIGHT. Then restart your new virtual AP.

Now is a good time to load the second part of this lesson's start configuration. Your Devices page will complain in section Install verification, which is what we expect and it will be fixed in the next step.


Running the Install

As you certainly recall, the AP is installed on a gateway using the Install dialog available on the gateway's web interface. With the IPVA / VAP tandem it works quite similar: the Install on the IPVA can setup a foreign AP, which is our virtual AP.

For this, you would launch the Install on your IPVA and screenshot.png select the Upgrade the existing PBX with installation of an external App Platform mode.

To make sure you run the Install in English language and use the moodle store:
  • start it using this link
  • select the installation mode Master PBX to start a new system with external App Platform
  • leave everything as-is in the Network settings and Update sections
  • use apps2.dvl-ckl2.net in the App Platform address field and ip411 in the Password field on the Existing App Platform (e.g. VM) page
  • on the page innovaphone PBX options use
    • Christoph Künkel as Display name,
    • nobody@nowhere.tld as Email address (we will turn off 2FA later on),
    • ckl as Account,
    • ip411 as Password,
    • dvl-ckl2.net as Domain name,
    • hq2 as PBX location name,
    • hq2.dvl-ckl2.net as DNS name of the PBX (this is what the Install suggests anyway). You need to tick Use DNS to access myApps for this,
    • apps2.dvl-ckl2.net as DNS name of the App Platform (this differs from what the Install suggests),

There is no need to install any voice mail or configure the dialing prefixes

  • be sure to un-tick the Email account check-mark so no 2FA will be done
The Install will then install the App Platform as well as the PBX. Do not forget to turn on the test mode before you restart the box!

Provisioning your IP111

As we'd like to have at least one phone registered with the new PBX, we need to provision the IP111.

Provision your IP111 as an IP phone for user ckl (using myApps at http://hq2.dvl-ckl2.net/PBX0/APPCLIENT/136146/appclient.htm?lang=en#).

Now that we have seen how to set up both a PBX and an AP based on virtual machines, we will look a bit at the differences between a PBX running on a gateway and a PBX running on a virtual machine. This is what the next book Specific characteristics of the IPVA is all about.