Adding UniFi Access Point to Controller

Hi all! I am going to do a quick run-through of adding UniFi Access Points to a controller running on a Windows host.

Let me start off by saying how impressed I am with the UniFi line. They really are giving the big wireless guys a run for their money, including Cisco and Meraki.  With their no-license model and free controller software (that’s right – FREE), they are a great solution for any small, medium, and even large businesses. You can do a ton of options with UniFi, including guest policies, portal customization, WPA-Enterprise, and much more. Hopefully I will get a chance to cover all of these cool features in the future.

So, you’ve purchased a single UniFi WAP or 3-pack and have no idea what to do next. Well, first you MUST install your controller software on a Windows, Mac or Linux machine. If you don’t have a PoE switch, they also come with power injectors in the box!

After installing the controller, configure the initial admin username/password and login. Plug-in the APs. Hopefully, your APs will show up automatically during the setup process and you can add them to the controller. If they do not show up, chances are that your APs are on a different subnet than your controller. Basically, the APs will send out a broadcast discover to find out the location of the controller. Standard networking concepts will tell you that broadcasts do not traverse subnets. So how do you add it to a controller on a different subnet?

You will need to get the IP address of the AP by searching on your DHCP server – the MAC address will start with 04:18. After figuring out the IP address, SSH into it with a client like PuTTY. Login to the AP with ubnt / ubnt. Then, run the following command:

set-inform http://<ip of controller>:8080/inform

This will cause the AP to send a discovery unicast packet directly to the controller. You should now see the AP appear on the controller. Adopt the AP and run the set-inform command again. The AP will then reboot and then will be officially adopted on the controller!

Unfortunately, this particular multi-subnet scenario is not documented well in the UniFi documentation. So I hope this helps – enjoy your new access points!

Official user guide: http://dl.ubnt.com/guides/UniFi/UniFi_AP_AP-LR_User_Guide.pdf

Good Wiki documentation: http://wiki.ubnt.com/UniFi_FAQ

Expanding a Citrix PVS VHD Image

Ah, Citrix Provisioning Services… argumentatively one of the most ingenious technologies when it comes to Citrix’s XenApp/XenDesktop suite. PVS gives administrators the ability to install application updates, perform image maintenance, maintain version control, etc. without ANY service interruptions to production virtual desktops. On top of that, the cache-to-RAM/overflow-to-disk option (7.1) gives storage administrators a huge relief, since all VM “writes” are written to a cache pool, located on the RAM of the virtual machine! (Read more here):

http://blogs.citrix.com/2015/01/19/size-matters-pvs-ram-cache-overflow-sizing/

However, I have noticed one major flaw in PVS, and that is the ability to expand the base image VHD (the read-only copy that everyone is steaming from). Is it doable? Yes. Is it supported by Citrix? No (CTX118608). Is it way more difficult than it should be? Maybe. That really depends if you have decided to go to a 16MB vs. 2MB dynamic block size. Although you [theoretically] get better performance out of the 16MB block size (and sacrifice a small amount of storage, since you’re eating up the entire 16MB block, per each written block), you do lose the ability to natively manage the VHD utilizing diskpart or Hyper-V, because Windows is not compatible with the 16MB-blocked VHD! Does Citrix have this documented anywhere? Absolutely not.

If you’re lucky enough to have the 2MB block size, you can simply create a new merged base of your image, rename the VHD and PVP files, and delete the LOK file. You will then want to delete the version in the Versions window. This will delete the version from the PVS database, but since you’ve renamed it, it will not delete the VHD.

Afterward, run diskpart:

diskpart
Select vdisk file=”[Location of VHD]”
list vdisk
expand vdisk maximum=[#ofMB]

You can then exit diskpart and expand the partition by mounting the VHD and expanding it in disk manager. Then take the disk offline and unmount it. Afterward, you can import the disk back into PVS.

Now, the really tricky part is expanding the VHD when you have the 16MB block size. If you try and mount the VHD like we did the 2MB-blocked one, you’ll get an error about the disk being corrupted. The only way is to convert this back to the 2MB VHD. So, how can we do that?

First, you will need to utilize a tool called CVhdMount.exe, in combination with the disk tools found in Hyper-V. Chances are, your PVS server does not have the Hyper-V role installed, so you will need to put this tool on your Hyper-V server. This tool can be found in Program Files\Citrix\Provisioning Services on your PVS server. You will also need to install the drivers found in Provisioning Services\Drivers on your Hyper-V server so that it can work with these special VHDs. Copy both the CVhdMount.exe and drivers folder to the Hyper-V host. The rest of the instructions are on Hyper-V.

Next, right-click cfsdep2.inf and hit install. Then, in device manager, add legacy hardware manually, as a storage controller.  Click Have Disk… and point it to CVhdMp.inf. This will install the Citrix Virtual Hard Disk Adapter so that CVhdMount.exe has the instructions on how to operate.

Afterward, run CVhdMount.exe -p 1 “[path to VHD]

You’ll get a magical message that the bus interface has been opened with device serial #1. Now, open up disk manager, and you will see that the disk is there! Set the disk to Offline so we can perform the VHD conversion, without risking the chance of corruption.

Next, in Hyper-V manager, select New > Hard Disk and create a dynamic VHD. Instead of creating a new blank virtual disk, copy the contents of an existing physical disk (your magically attached VHD!). This could take awhile, depending on the specs of your Hyper-V host. After the new 2MB VHD is created, edit the disk using Hyper-V manager to expand it to the new appropriate size.

Copy the VHD over to your PVS storage, import it in the PVS Console, and you should now see your new 2MB-blocked VHD!