Course13:IT Plus - Setting up a virtual appliance on Hyper-V (IPVA)

From innovaphone wiki
Jump to navigation Jump to search

How to set up a virtual PBX (IPVA) on Hyper-V

IPVA

The innovaphone Virtual Appliance is an implementation of innovaphone's gateway firmware (including the PBX) that can run as a native guest operating system directly on a virtualization platform such as fish-help.png VMware or fish-help.png Hyper-V. Therefore, no Windows or Linux instance is required within the virtual machine.

All components of the standard firmware are supported except of course that there are no physical interface such as POTS or ISDN. The SSD found in innovaphone hardware devices is emulated on the host systems file system (although strictly speaking the IPVA emulates the older compact flash card type of drive). The IPVA therefore presents a very capable platform for PBX, SBC and RP applications. Given the fact that it is free, it is also an ideal platform to simulate larger systems during our trainings.

In this book we will look at running some IPVAs based on the Hyper-V platform.

Note that it is also possible to run the Application platform in a virtual machine. This is covered in a separate book: Setting up a virtual application platform on Hyper-V (VAP).

Virtualization and IPVA

Hyper-V is a virtualization platform (sometimes also known as hypervisor). A hypervisor runs on a computer (server or desktop) known as virtualization host. The operating system running the hypervisor hence is known as the host operating system. Inside (or on top, as you like) the hypervisor, you can run one or more virtual machines, also known as guests. These machines appear to other programs like a real hardware (with only little differences). So you can run programs that are intended to run on a computer hardware on it. Examples for such programs are operating systems such as Windows or Linux. In this case, the operating system on a virtual machine is known as a guest operating system. The guests running on the same hypervisor would then share the resources available on the host operating system. It is possible to run several hundred guests on a capable host.

Virtual machines are represented as a set of plain files on the host system. As such, they can be created, copied, backed-up and deleted using standard file management tools. Also, virtual machines have a fairly standard file format (known as .ova) so they can be shared as file. Those can be imported to a new virtual machine, thereby circumventing the necessity to manually install the guest to the virtual machine (as it is already present in the imported virtual machine).

Benefits



The obvious benefit of virtualization is that you can better utilize the host's resources among multiple guests. In addition to that, virtualization gives you a number of interesting options. To name just a few:
  • you can test-run operating systems, applications and their upgrades. You would setup a new guest or create a copy of the current guest and do the test on the new guest first
  • you can scale your IT infrastructure more easily and at lower cost
  • you can move guests across hosts to accommodate your performance needs
  • you can pre-configure guest images tailored to your needs

Licensing

Note that when using a hypervisor, you need to follow both the host operating systems, the hypervisors and the guest operating systems license terms! For example, if you install a Windows 10 system as a guest, you need to have a valid (that is, additional) license for it. You can't just use an existing license and re-use it on a virtual machine.

IPVA as a guest

In this course, we will use virtualization to easily set up multiple PBXs by creating multiple guests and run a copy of the IPVA in each of them.

The thing that differentiates the IPVA from other applications is that it does not need to run on a (guest) operating system. Instead, the IPVA is the guest operating itself. So you do not need to install Windows or Linux within the guest and then install the IPVA as an application. Instead, you simply install the IPVA as the guest operating system itself directly in to the virtual machine.

innovaphone provides the IPVA without cost, that is, there is no licensing required to run the IPVA. There is a licensing requirement if you actually run the PBX which is part of the IPVA but as you probably already guessed, we don't care in the course as we are using the test mode as always.

So in terms of licensing, we have
  • the host operating system
    This is your Windows 10 installation you have anyway
  • the hypervisor
    Hyper-V on a Windows 10 system is free, so you need no license for it
  • the guest operating system
    This is the IPVA and we have learned by now, we do not need licenses to run it during the course

Preparing Hyper-V on Windows 10

We're assuming that you will use your training-PC to run Hyper-V. And we're assuming that you run Windows 10 (any flavor except for Home) or later to run it (so this would be your host machine and hence Windows 10 your host operating system).

Theoretically, you could however use another host operating system such as Windows Server to run Hyper-V. You could even use another hypervisor such as VMware which in turn can run on various host operating systems such as Windows, Linux or ESX (which is VMware's host operating system which runs directly on your hardware and allows you to get rid of any standard host operating systems). However, you're on your own in these cases and need to refer to the fish-help.png Concept Innovaphone Virtual Appliance or fish-help.png Concept IPVA On Hyper-V articles available in our wiki.

Activating the Hyper-V feature

First of all, although Hyper-V is available on all Windows 10 Pro or Enterprise, it needs to be turned on.

For this,
(Further Hints) We have seen situations where Windows fails to install Hyper-V complaining something like The referenced assembly is not installed on your system. Error code 0x800736B3. In this case, try to install the four individual components (you can see them when you expand the Hyper-V entry) one after the other. This seems to help sometimes.
     

Creating the virtual network

So that your virtual machines and hence your IPVAs can communicate with your physical network, you need to create a virtual network and attach it to your physical network.

This is done in the Hyper-V manager:
  • Click on the screenshot.png Windows start button and type hyper
  • select Hyper-V Manager
  • right click on the name of your machine in the left tree pane
  • select screenshot.png Virtual Switch Manager... (or Manager for virtual switches depending on your platform)
  • in the new window opened, click on screenshot.png New virtual network switch (the type of virtual switch must be External)
  • change the Name: to Virtual Switch External (make sure you exactly use this name!)
  • select screenshot.png External network as Connection type and make sure to select the network interface that connects to your training network

You can enter any Notes: you like but you must leave the VLAN ID check-mark un-ticked

  • finally click on OK to create the new virtual switch
    You might see a screenshot.png scaring warning. Just keep your faith and say Yes
(Further Hints) Hyper-V's virtual switch manager will modify your host PC network adapter settings. However, it should still "just work". If need be, see Networking Implications For The Windows Host in fish-help.png Concept IPVA On Hyper-V for details.
     

Preparing the "Training Setup Device Definition"

If one or more virtual machines are required in your current topic, you need to define their MAC addresses in the https://class.innovaphone.com/moodle2/pix/f/web.gif Training Setup Device Definition.

A virtual machine's network adapter can be configured to either user a dynamic (that is, random) MAC address or to use whatever fixed MAC address you like (or need).

Therefore, we can define fixed MAC addresses for your virtual machines as follows:
  • 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
We will see later on how to arrange that your virtual machines use these MAC addresses.

Note that the APPPLATFORM (as opposed to APPPLATFORM2) entry relates to the App platform that runs on your IP411LEFT. Its MAC address is the same as of the IP411LEFT except for the first byte which is replaced by 02 (02-90-33-40-02-B3). (Further Hints) This cannot be changed and you must not change the value used for APPPLATFORM therefore!

(Further Hints) Theoretically, you could use whatever MAC address you like for your virtual machines. However, in the course, there must not be two devices with the same MAC address. Therefore, use of the above shown addresses is recommended.

Also, as we will see in another book, IPVAs must use MAC addresses out of specific address ranges so that they can be accepted by innovaphone's license portal. See fish-help.png My Innovaphone for a list of valid ranges.

Creating an IPVA virtual machine

Now that we have enabled hypervisor support on our PC (which has to be done once only on a given PC obviously), we need to create a guest running the IPVA.

As said before, virtual machines can be described using a standard file format.

So we first need to:
The file we are interested in is the .XML file found in the ipva-vhd\bin\vhd\Virtual Machines folder. We can use this file to create our first IPVA virtual machine from it.

This is done as follows:
Unfortunately, the wizard does not ask for a new name,
so please
  • right-click on the new virtual machine and screenshot.png Rename... it to IPVA1 (so as to not confuse yourself when you create more virtual machines from the same template)

     

Downloading the IPVA template in real-life

After the course, you can download the IPVA virtual machine files from http://store.innovaphone.com/release/download.htm.

You would

(Further Hints) You only need the ipva-vhd.zip file. The ipva-ovf.zip is for VMWare platforms and the ipva-vmx.zip is an old, obsolete format for older VMware versions.

Of course, as you already have it, you do not need to do this now.

Adjusting the IPVA's MAC address

Hyper-V will create a dynamic (that is, random) MAC address to the virtual machine's network adapters. In most cases, this is good enough. However, in this course, we have pre-configured our IP411RIGHT as DHCP server with screenshot.png static address reservations for 4 virtual machines. For this to work, your IPVA's network adapter needs to use the correct MAC address (that is, those you screenshot.png have defined in your https://class.innovaphone.com/moodle2/pix/f/web.gif Training Setup Device Definition for your virtual machines).

Here are the MACs you have defined:
  • 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 this is our first IPVA, we shall use 00-03-FF-07-1F-F1.

To set this MAC address

Loading the lesson start configuration

Now is a good time to load the lesson configuration. When we do this before our new IPVA1 is started, it will load the correct configuration file right away when it is booted.

So load the start configuration files for this lesson to your devices

You can proceed to the next step right away (at this point, your Devices page will complain about at least the IPVA missing: this is what we will fix in the next step).

Starting the new IPVA

To start the new IPVA
  • right-click on your IPVA1 virtual machine in Hyper-V Manager and screenshot.png select Start
    The IPVA will boot now
  • to see the IPVA's IP address you can open the virtual machine's screenshot.png console window by right-clicking on your IPVA1 virtual machine again and select Connect...
    Your IPVA should use IP address 172.31.31.8.

Congratulations! You have created your first innovaphone virtual appliance.

Tweaking VM parameters

Virtual machines have some options that can be changed meaningfully. We'll go through them in this section.

(Further Hints) Hyper-V can not to change most of the virtual machine options while the virtual machine is running.

So to be able to change options:
(Further Hints) While we are at that: you can not screenshot.png Shut down... an IPVA as Hyper-V will screenshot.png complain that it fails to shutdown the virtual machine. This is because shutting down a guest operating system requires Hyper-V to know of a shutdown procedure available in the guest operating system. However, there is no such procedure in the IPVA - so just turn it off.


RAM

The virtual machine template (the one we used to import into Hyper-V) defines 256MB of main memory. However, this is not a fixed value:

  • You can reduce the main memory down to 32MB (the smallest value allowed by Hyper-V)
  • The maximum amount of memory usable in an IPVA is 3GB (3072MB). Even if you assign more memory to the virtual machine running the IPVA, there will be no benefit

So as to not waste too much precious memory on your training PC, let's lower the amount of memory allocated to the IPVA to 32MB:
  • open the virtual machine's Settings...
  • select Memory
  • reduce the screenshot.png RAM value to 32 MB
  • start the virtual machine again to see screenshot.png the effect on the IPVA's General/Info page
But, wait a moment! The setting was 32MB and the General/Info page shows only 30MB. Why that?

(Further Hints) The DRAM display on the General/Info shows the amount of memory available after system start. However, before the system can start, the boot code must decompress the firmware from flash memory to RAM. The amount of memory required to do this is what is missing here.
     

Dynamic memory allocation

Hyper-V features a so-called Dynamic Memory mode. In this mode, not all the IPVA's physical host memory is allocated immediately. Instead, some memory is only assigned to the system when needed. However, this only works with guest operating systems which support memory paging. The IPVA OS does not support this.

(Further Hints) Hyper-V's screenshot.png dynamic memory can not be used for an IPVA.

Flash memory basics

The flash memory size is set to 64MB by default (that is, in the virtual machine template we imported before). The flash size can be changed too, but it is a bit more tricky.

To understand how it works, you need to know that flash memory is emulated on an IDE drive (controller 1, location 0) in the IPVA. Hyper-V in turn emulates this IDE drive on a file on the host operating system (which is called hd-flash.vhd).

To provide more (virtual) flash memory to the virtual machine, we need to change the file that is used as flash memory (hd-flash.vhd in our imported machine) for a file that has more space. We'll discuss in minute how this can be done.

If we do so, the IPVA will recognize the increased flash size and screenshot.png display it as part of it's home page.

Unfortunately, this alone is not enough. Although the IPVA will write to the flash immediately, it will use a read-cache for speed. Therefore, the entire flash content is shadowed in RAM. For this to work, there must be enough RAM obviously.

For example, when we have configured 32MB RAM and 128MB flash, the !mod cmd FLASHMAN0 info state command (which we can issue in Maintenance/Command on the IPVA advanced UI) will output:

segments=3, segment-size=0x10000 (64k)
LDAP - used 13k avail 50k owned 64k (segments 1) maximum 3712k (segments 58, configured 58)
VARS - used 16k avail 38k owned 64k (segments 1) maximum 640k (segments 10, configured 10)
segment state
2 owned by VARS, LDAP, ...
68 configured maximum for VARS, LDAP, ...

While this might appear to be a bit cryptic, it tells us that the flash memory is organized in segments of 64kB each and that 2 of them are currently owned by an application and 68 are available in total. 68 multiplied by 64 kB is 4352 kB or 4.25 MB. Obviously much less than 128MB.

When we configure 448MB RAM instead of 32MB with the same 128MB flash size, the !mod cmd FLASHMAN0 info state command will output:

segments=3, segment-size=0x10000 (64k)
LDAP - used 13k avail 50k owned 64k (segments 1) maximum 129728k (segments 2027, configured 2027)
VARS - used 17k avail 36k owned 64k (segments 1) maximum 640k (segments 10, configured 10)
segment state
2 owned by VARS, LDAP, ...
2037 configured maximum for VARS, LDAP, ...

Now the IPVA's flash management has determined that there is enough RAM available for the cache and therefore enabled a total of 2037 segments (which is equivalent to 130368 kB or 127,3125 MB of flash memory) - which is what we aimed for.

(Further Hints) To take advantage of the increased flash memory size, also the RAM size needs to be increased substantially so that it can safely hold the flash's in-memory read-cache.

There is also a further limitation you need to be aware of. The flash management can only deal with (virtual) flash sizes which are integral multiples of 64 MB. There is no use in configuring 96 MB of flash memory, you must either use 64 or 128.

Also, the maximum flash size is set to 512MB.

Flash size and RAM

(Further Hints) As a rule of thumb, we recommend to configure 4 times more RAM than flash memory.

As said, this is a simple rule of thumb only. When you are actually using a large amount of flash memory, we urge you to monitor the amount of RAM used during real use of the IPVA and to adjust the RAM size if need be. Otherwise, use of the flash memory may ultimately end up in an out-of-memory crash of the IPVA!

(Further Hints) You have to think carefully before you tinker around with flash memory size. After all, if you intend to do so, you probably will have good reason. Most likely, you will want to manage more PBX objects. And more PBX objects will probably end up in more calls which create more network bandwidth and CPU usage. In the end, many system components will suffer increased workloads. As a result, we do not recommend to change the IPVA's flash memory size, unless you really know what you are doing!

To give you an idea: flash memory is mostly used for PBX objects and the size of a PBX object will rarely exceed 2 kB. In a 64 MB flash memory, you can thus store about 30000 entries. If you think you can get away with this, then the more interesting outcome of this chapter is: if you reduce the RAM for an IPVA (which may make a lot of sense), then as a side effect, also the effective flash memory size is reduced (see above).

How to create a flash file

Unfortunately, the Hyper-V Manager on Windows 10 does not allow you to create or modify disks so that their size is only a fraction of a GB.

Then again, there are various cmd-lets available as part of the windows powershell console. So let's try this!

To create a new 128MB file for use as the IPVA's flash, proceed as follows:
  • press the Windows start button
  • type powershell
  • right click on Windows PowerShell
  • select Run as administrator
  • determine where Hyper-V screenshot.png stores your virtual machine hard disks (probably something like C:\Users\Public\Documents\Hyper-V\Virtual hard disks)
  • type the command cd "C:\Users\Public\Documents\Hyper-V\Virtual hard disks" into the Powershell console
  • type screenshot.png the command new-vhd -Path .\hd-flash128.vhd -SizeBytes 134217728 (134217728 is 128*1024*1024)
  • this new file can be screenshot.png configured as new IDE Controller 1, Location 0
    (Further Hints) If Windows complains about an already existing drive on that position, simply remove it before setting the new file
As we learned before, you also need to configure a RAM size of at least 448 MB for the increased flash size to take effect. You can try that now and see the effect on the IPVA1's home page and for the !mod cmd FLASHMAN0 info state command yourself. However, chances are that Hyper-V will be unable to allocate enough memory when you try to start the virtual machine.

(Further Hints) If your PC has not enough RAM memory available to run a virtual machine with 448 MB RAM, simply configure it back to 32 MB and proceed. The lesson checker will accept both configurations.

Obviously, the flash size won't effectively be increased in the latter case.

By the way: as we effectively cleared the IPVA's flash memory, the current lesson information is lost. Therefore, you will see a screenshot.png respective note in the lesson checker. You can safely ignore this.




For more Hyper-V related Powershell cmd-lets see the www.png complete reference.

CF card

The IPVA emulates a compact flash card. In the template we used to import our IPVA, the size of this compact flash is set to 1024MB (1GB).

Like with the flash memory, the CF "card" is emulated based on a virtual drive (IDE Controller 0, Location 1) which is in turn implemented as a file called hd-cf.vhd on the host system by Hyper-V. You can see this when you look at screenshot.png the settings for that hard drive.

You can see the current size of the CF card screenshot.png on General/Compact-Flash on your IPVA. It is roughly 1GB, which matches with the results you see when using screenshot.png the Inspect button in the Hyper-V Manager.

Changing the size of the CF card works much like changing the flash memory size therefore:
After that, the Inspect button will show you screenshot.png the increased size. But looking at General/Compact-Flash will still screenshot.png show the old size.

However, the startup trace (available from Maintenance/Tracing/trace (buffer)) reads like:
0:0000:165:4 - start ide IDE1 0:0000:165:4 - IDE1(ATA) 0:1 lba=4194304 2048MB c/h/s=4161/16/63 - Virtual HD 
So the physical disk size (2048MB) is increased indeed.

(Further Hints) A change in physical disk size needs a new full format to take effect.

To finally get at the expanded CF card:
Now you have the full screenshot.png 2.045,99 MB available on your CF card.

Needless to say that you of course will loose all data that was on the flash disk before!

(Further Hints) The maximum size for the CF card is 128 GB (131,072 MB).

Virtual processors

The innovaphone OS (which is running on all innovaphone devices as well as on the IPVA) is a single processor OS. For this reason, it does not make sense to assign more than one virtual processor to an IPVA.

(Further Hints) As of V13r2 SR1, the IPVA firmware has experimental multicore support which is used as soon as you assign more than one virtual processor (this is likely to be removed in later service releases). It is not recommended to use this feature in a production environment. So please always keep the screenshot.png standard setting of 1!

Using other platforms

For information on running Hyper-V on non-Windows10 platforms, see fish-help.png Concept IPVA On Hyper-V.

For information on running the IPVA on VMware, see fish-help.png Concept Innovaphone Virtual Appliance.

Section test

Now is a good time to do the section test in Section test (Setting up a virtual appliance on Hyper-V (IPVA).