The easiest way to setup ''AN!CDB'' is to use the <span class="code">[https://alteeve.ca/files/an-cdb-install.sh an-cdb-install.sh]</span> script.
Installing ''AN!CDB'' is pretty easy. Please jump to the tutorial below and return here once ''AN!CDB'' is installed.
Install [[CentOS]] or [[RHEL]] version 6.x on your dashboard server. Configure the network interfaces so that the dashboard can connect to the [[IFN]] and [[BCN]].
* [[Installing AN!CDB]]
Once the network is setup and the install is complete, download this file;
Once you have save the install script, edit it with your favourite text editor and change the following;
<syntaxhighlight lang="bash">
vi an-cdb-install.sh
</syntaxhighlight>
<syntaxhighlight lang="bash">
# Change the following variables to suit your setup.
PASSWORD="secret"
HOSTNAME="an-m03.alteeve.ca"
CUSTOMER="Alteeve's Niche!"
</syntaxhighlight>
Once the changes are saved, run the script. It could take quite a while to complete depending on how slow your dashboard machine is, how slow your internet connection is and how much needs to be downloaded.
generally, this will update the kernel and/or install the graphical desktop. Generally you will want to reboot at this point.
As it says above, remember to edit the <span class="code">/var/www/home/ricci_pw.txt</span> and <span class="code">/etc/an/an.conf</span> files to add the information for the ''Anvil!''s you want this dashboard to have access to.
Also remember to log into the <span class="code">apache</span> user's terminal and [[SSH]] to each node. This will ask you to verify the node's fingerprint and then record it in the <span class="code">apache</span> user's <span class="code">/var/www/home/.ssh/known_hosts</span> file. The dashboard '''will not connect''' to a node until this is done.
AN! generally installed the ''AN!CDB'' on [[ASUS EeeBox Specific Notes|ASUS EeeBox PC-EB1033]] 1-liter nettop PCs. You should be able to use any computer or appliance that can run the 64-bit version [[RHEL]] or [[CentOS]] version 6.
== Adding an Anvil! to a Dashboard ==
Adding an ''Anvil!'' to a given dashboard involves a few steps;
# Setting up [[SSH]] access from the dashboard to your nodes.
# Adding the ''Anvil!'''s details to the dashboard's <span class="code">/etc/an/an.conf</span> file.
# Adding the ''Anvil!'''s <span class="code">ricci</span> user's password to the dashboard's <span class="code">/var/www/home/ricci_pw.txt</span> file.
# Adding each node to the dashboard's ''Virtual Machine Manager'' application.
=== Adding the AN!CDB SSH keys to the Nodes ===
When the dashboard was installed, a desktop file should have been created called <span class="code">public_keys.txt</span>. This file contains the keys needed to provide [[2-Node_Red_Hat_KVM_Cluster_Tutorial#Setting_up_SSH|password-less SSH]] access for the dashboard's <span class="code">apache</span>, <span class="code">alteeve</span> and <span class="code">root</span> users. Strictly speaking, the only key you need to add to the nodes is the <span class="code">apache</span> user. The dashboard can not authenticate against a node otherwise (at this time... patches welcomed!).
Adding the <span class="code">alteeve</span> user's key allows ''Virtual Machine Manager'' to connect without having to enter a password. If you prefer though, you can leave out the <span class="code">alteeve</span>. Adding the <span class="code">root</span> user's key may come in handy if you use the dashboard machine as a gateway into the cluster. Adding the <span class="code">root</span> user's key is the least important and safe to leave out if you prefer.
{{note|1=In this example, we will be connecting to an ''Anvil!'' called <span class="code">an-cluster-05</span> which has the two nodes named <span class="code">an-c05n01</span> and <span class="code">an-c05n02</span>. Please substitute these names for the name of your ''Anvil!'' and it's nodes.}}
Open a terminal window as the <span class="code">alteeve</span> user. To do this, log into the dashboard's graphical interface and the open a terminal window by clicking on;
You will be asked to verify the node's [[SSH fingerprint]]. If you trust the fingerprint is accurate, type <span class="code">yes</span>.
<syntaxhighlight lang="text">
The authenticity of host '[an-c05n01]:22501 ([216.154.16.237]:22501)' can't be established.
RSA key fingerprint is 44:01:06:85:00:6f:b2:56:51:00:e1:16:af:4c:01:ee.
</syntaxhighlight>
<syntaxhighlight lang="text">
Are you sure you want to continue connecting (yes/no)? yes
</syntaxhighlight>
<syntaxhighlight lang="text">
Warning: Permanently added '[an-c05n01]:22501,[216.154.16.237]:22501' (RSA) to the list of known hosts.
</syntaxhighlight>
The node's fingerprint will be added to the <span class="code">alteeve</span> user's <span class="code">~/.ssh/known_hosts</span> file. You should not be asked to verify the fingerprint again.
Next, you will need to enter to node's <span class="code">root</span> user's password.
<syntaxhighlight lang="bash">
root@an-c05n01's password:
</syntaxhighlight>
When you enter the password, you will so no feedback at all. If you entered the correct password, it should simply have returned to the terminal. You can verify that this worked by trying to log into the node.
<syntaxhighlight lang="bash">
ssh root@an-c05n01
</syntaxhighlight>
<syntaxhighlight lang="bash">
Last login: Sun Jul 28 20:17:14 2013 from alteeve.ca
an-c05n01:~#
</syntaxhighlight>
Now exit out to return to the dashboard's terminal.
<syntaxhighlight lang="bash">
an-c05n01:~# exit
</syntaxhighlight>
<syntaxhighlight lang="text">
logout
Connection to an-c05n01 closed.
</syntaxhighlight>
Now switch to the <span class="code">apache</span> user.
<syntaxhighlight lang="bash">
su - apache
</syntaxhighlight>
Enter the <span class="code">apache</span> user's password. This was set when you ran the <span class="code">an-cdb-installer.sh</span> script. There is no default password.
<syntaxhighlight lang="text">
Password:
</syntaxhighlight>
If the password was correct, you will get the <span class="code">apache</span> user's shell.
<syntaxhighlight lang="bash">
-bash-4.1$
</syntaxhighlight>
Now try using <span class="code">ssh</span> to connect to the node.
<syntaxhighlight lang="bash">
ssh root@an-c05n01
</syntaxhighlight>
As this is a different user, you will again be asked to verify that the SSH fingerprint is accurate. If you trust it, type <span class="code">yes</span>.
<syntaxhighlight lang="text">
The authenticity of host '[an-c05n01]:22501 ([216.154.16.237]:22501)' can't be established.
RSA key fingerprint is 44:01:06:85:00:6f:b2:56:51:00:e1:16:af:4c:01:ee.
</syntaxhighlight>
<syntaxhighlight lang="text">
Are you sure you want to continue connecting (yes/no)? yes
</syntaxhighlight>
<syntaxhighlight lang="text">
Warning: Permanently added '[an-c05n01]:22501,[216.154.16.237]:22501' (RSA) to the list of known hosts.
Last login: Sun Jul 28 20:43:46 2013 from alteeve.ca
an-c05n01:~#
</syntaxhighlight>
Now type <span class="code">exit</span> to return to the dashboard.
<syntaxhighlight lang="bash">
exit
</syntaxhighlight>
<syntaxhighlight lang="text">
logout
Connection to an-c05n01 closed.
</syntaxhighlight>
That's it!
Repeat this process for your other node, <span class="code">an-c05n02</span> in this case.
=== Configuring 'an.conf' ===
The <span class="code">an.conf</span> file is where you tell ''AN!CDB'' which ''Anvil!''s your dashboard will be able to manage.
By default, four sample ''Anvil!''s are pre-loaded in the config. Each Anvil has found variables that need to be set;
* <span class="code">name</span>; This is the ''Anvil!'''s cluster name. If you don't know the cluster name, you can find it on either node at the top of the <span class="code">cluster.conf</span> file in the <span class="code"><cluster ... name="..."></span> element. If you have console access to one of the nodes, you can run this slightly odd looking [[bash]] command;
* <span class="code">nodes</span>; This is a comma-separated list of the node names. These are the names (or [[IP]]s) that the dashboard will call when connecting to the nodes. So please be sure that the names resolve to the proper IPs. Usually, the names should resolve to the cluster's [[BCN]]. In most ''Anvil!''s, the short host name can be used to resolve each node's [[BCN]] network IP address. If this is true for you as well, then you can get the host names this way;
* <span class="code">company</span>; This is a free-form descriptive field that you can fill out however you wish. The value here is used in the second column of the ''Anvil!'' selection screen. Generally, it is the company, institution or organization name that owns the ''Anvil!''.
* <span class="code">description</span>; This is also a free-form descriptive field that you can fill out however you wish. The value here is used in the third column of the ''Anvil!'' selection screen. Generally this is some descriptive field used for the informal name of the ''Anvil!'', where it physically is located, etc.
The format of the <span class="code">an.conf</span> configuration file is <span class="code">cluster::X::variable</span> where <span class="code">N</span> is some unique number. The order of the numbers does not matter at all, it simply provides a method of distinguishing the values of one ''Anvil!'' from another.
So, by default, the first two sample ''Anvil!'' configurations are;
If you have only one ''Anvil!'', you can simply delete the three other sample entries. Then you can replace the values in the remaining one with the details on your ''Anvil!''.
There is no (practical) upper limit to the number of ''Anvil!''s that a given dashboard can support.
=== Configuring 'ricci_pw.txt' ===
In order for ''AN!CDB'' to add or remove servers, it must be able to authenticate against the cluster stack. The cluster stack has [[2-Node_Red_Hat_KVM_Cluster_Tutorial#Setting_Up_ricci|it's own password]] for this purpose. This password is set by assigning a password to each node's <span class="code">ricci</span> system account.
The dashboard keeps these passwords separate from the general ''Anvil!'' configuration found in <span class="code">an.conf</span>. These passwords instead are saved in <span class="code">/var/www/home/ricci_pw.txt</span>.
This configuration file is much more simple to configure. You need to set the variable name to the cluster name that you set in <span class="code">an.conf</span>'s <span class="code">cluster::X::name</span> value. The password for that ''Anvil!'' is on the right, separated by an <span class="code">=</span> sign.
So continuing our example above, the ''Anvil!'''s <span class="code">cluster</span> name was <span class="code">an-cluster-05</span>. The <span class="code">ricci</span> password on this ''Anvil!'' is <span class="code">secret</span>. So the <span class="code">ricci_pw.txt</span> entry would be:
<syntaxhighlight lang="text">
an-cluster-05 = "secret"
</syntaxhighlight>
Note that simple passwords do not need to be in double-quotes. However, if your password is complex and has special characters or spaces, the double-quotes ''are'' needed to ensure that the password is parsed properly.
You can put as many ''Anvil!'' entries in this file as you wish. Simply ensure that each entry is on it's own line.
=== Configuring Virtual Machine Manager ===
The ''Virtual Machine Manager'' application is a separate tool that is available on the ''AN!CDB'' appliances. You can think of it as a kind of [https://en.wikipedia.org/wiki/KVM_switch KVM switch] for your server running on your ''Anvil!''s.
It gives you a way to directly access your servers, just as if you were sitting at a real keyboard, mouse and monitor plugged into a physical server. With it, you can watch your servers boot up, shut down and you can work on your servers when they have no network connection at all.
Normal remote management tools, like [https://en.wikipedia.org/wiki/Remote_Desktop_Protocol RDP] for windows servers, [[SSH]] for [[Linux]] and [[UNIX]] and other tools require that the target server be up and running and have a working network connection. Most of the time, these are perfectly fine. Sometimes though, network settings are configured improperly, bad firewall rules lock out remote access and so on. These time require direct access and that is where ''Virtual Machine Manager'' comes in very handy.
The steps to add the nodes are (in the same order as the images above);
# On the dashboard's desktop is an icon called "Virtual Machine Manager".
# Double-click on it and it will start the program.
# Click on "''File''" -> "''Add Connection''"
# Fill in the details for the first node in your ''Anvil!''.
## Click to check "''Connect to remote host''"
## Enter the host name of the node (same as you put in <span class="code">an.conf</span> earlier)
## Click to check "''Autoconnect''"
## Clock on "''Connect''".
# The first node should appear in the main window. If you already have servers running on that node, they will appear. Otherwise they will appear when they are booted or created.
# Repeat steps #3 and #4 to add the second node.
That's it! You now have direct access to your servers. Simply run "''Virtual Machine Manager''" when ever you want. It's use is totally independent of the ''AN!CDB'' dashboard proper.
It's first and foremost goal is to be extremely easy to use. No special skills or understanding of HA is required!
To achieve this ease of use, the cluster must be built to fairly specific requirements. Simplicity of use requires many assumptions be made.
AN!CDB provides;
A single view of all cluster components and their current status.
Control of the cluster nodes. Nodes can be:
Powered On, Powered Off and Fenced
Join to and withdrawn from the cluster
Control of the virtual servers. Servers can be:
Booted up, gracefully shut down and forced off
Migrated between nodes
Create, modify and delete servers;
Create and upload installation and driver media
Provision new servers, installing from media just like bare-iron servers
Insert and Eject CD/DVD images
Change allocated RAM and CPUs
Delete servers that are no longer needed.
AN!CDB is designed to run on a machine outside of the cluster. The only customization needed is for the cluster name and the name of the nodes be added to the program. Once done, AN!CDB will collect and cache everything needed to control the cluster, even when both nodes are offline.
Note: AN!CDB is a constantly evolving, changing and improving project. It is highly likely that the version you install will differ somewhat from what is shown in this manual.
Feel free to jump to the section you are interested in. The order below was compiled as a "story line" of how someone might use AN!CDB to "cold boot" a new Anvil!, create some servers, take a node out for maintenance, manage existing servers, boot a windows server off of the install disk for recovery, "cold stop" and Anvil! and delete servers.
All screen shots shown here were taken in late July 2013. AN!CDB is always evolving so what you see today may differ somewhat from what you see here.
Connecting to the Dashboard
Connecting to the Dashboard
AN!CDB Login prompt.
Open a web browser and browse to the dashboard. Here we will use the actual dashboard's desktop, so we will browse to http://localhost. If you connect from another computer, browse to the IP address or host name you setup for the dashboard.
When you first connect, you will be asked to log into the dashboard. The default user name is admin. There is no default password, but it usually set to the same password used when logging into the dashboard's desktop as the alteeve user.
If you do not know what the password is, please contact support. We can not recover your password, but we can help you reset it.
Choosing the Anvil! to Work On
Choosing an Anvil!
Choose the Anvil! you wish to work on.
If you have configured your dashboard to work on two or more Anvil!s, the first screen you see will ask you to select the one you wish to work on. This list is created by reading your /etc/an/an.conf file on the dashboard. By default, four sample entries are created. You will need to edit the an.conf configuration file to point to your Anvil!(s) before you can use the dashboard to control them.
If you have only one Anvil!, you will not see this screen.
If the dashboard sees only one Anvil! in the configuration file, it will automatically be selected.
The Loading Screen
Choosing an Anvil!
The ever-present AN!CDB loading screen.
The dashboard does not cache or record an Anvil!'s state. Each time the dashboard needs to display information about the Anvil! and before performing an action on an Anvil!, the dashboard calls the nodes directly and checks their current state.
What this means is that you will frequently see the dashboard loading screen. This is an animated pinwheel asking you to wait while it gathers information.
When you see this screen, please be patient. The dashboard will wait up to 1 hour and 40 minutes, by default, for the cluster to return information. This is far longer than any action should take, of course. If you wait several minutes and the loading screen is still displayed, feel free to click on the "reload" icon to the right of the top logo.
Dashboard Buttons
AN!CDB buttons.
There are two main buttons that you will see and use often. They are the "Back" button (not to be confused with your browser's "Back" button) and the "Refresh" button. In addition, the main dashboard logo is click-able and will either return you to the Anvil! selection screen or, if you have just one Anvil!, return you to the main dashboard page.
The "Back" button, #1, will return you to the status and control screen for the currently selected Anvil!.
The "Refresh" button, #2, will update the current screen to ensure that what you are seeing is accurate and up to date. It is a good habit to always click "Refresh" when ever you return to AN!CDB after a period of time away.
The main logo, #3, will return you to the Anvil! selection screen. If you have just one Anvil, it will be automatically selected causing it to behave like the "Back" button.
If you Anvil! nodes are both powered off, you will see the "Cold Start" screen. If your dashboard is connected to the Anvil!'s "Back-Channel Network" (BCN), you will be given the option to turn on both nodes or just one node.
In almost all cases, you will want to start both nodes at the same time.
To start both nodes, simply click on the "Power On Both" button. Should you ever want to turn on just one of the nodes, click on the "Power On" button that is on the same line as the name of the node you wish to boot.
Once you click on "Power on Both" or "Power On" for a single node, you will be asked to confirm the action. Click on the "Confirm" button and the dashboard will connect to each node's IPMI interface and ask it to boot the nodes.
After confirming the action, the dashboard will do an initial scan to make sure that the nodes can still be turned on. If someone else turned them on already, the dashboard will abort and tell you why. These checks are done because multiple people can use the dashboard at one time. In most cases though, your action will complete successfully.
If you go back to the main page before the nodes are booting, you will see one of two screens;
"No Access"; This tells you that the dashboard can see that the node is powered up, but it was unable to connect via ssh to the node. This means that the node is still powering up, a process that can take several minutes on most modern hardware servers.
"Connection Refused"; This tells you that the node's operating system is booting up, but not quite ready to accept ssh connections. The node should become accessible very soon. Click on the "refresh" icon at the top-right and you should be able to connect to the Anvil! in just a moment.
Start the Cluster Stack
Starting the Cluster Stack
The cluster stack is stopped.
Confirm the start operation.
The cluster stack has started.
The cluster stack is running.
To prevent a possible condition called a "Fence Loop", the cluster nodes are not allowed to automatically start the cluster stack when they boot.
After a cold start of the cluster, your Anvil! will not yet be able to run servers. The next step that is needed is to start the cluster stack by pressing the "Start Cluster" button. You will be asked to confirm the action, press "Confirm".
The two nodes in the cluster must have their stacks started at the same time (as opposed to one after the other). For this reason, the data coming back from the nodes can be mixed together. The main effect of this is that, sometimes, the formatting of the output can be skewed, as seen in the third screen shot above. This is harmless and safe to ignore.
When you click on the "back" button, you will see that the cluster stack is either starting or fully started. The fourth screen shot above shows the cluster after it has fully started. If you see anything that isn't green, please wait a moment and then click on the "refresh" button. Within a minute or two, everything should become green and you will be ready to proceed.
Media Connector
The Media Connector is used to make installation, driver and software media (CD and DVD images) available for use in servers. There are three ways that media can be added to an Anvil!;
Create an image of a physical CD or DVD disk.
Download from a website address.
Upload a file from your computer.
Once an image file is on you Anvil!'s shared storage, you will be able to use it to install a server's operating system or mount it in an existing server's (virtual) DVD-ROM drive.
Creating an Image from a Physical CD or DVD
Note: This step requires a physical CD or DVD drive be installed or plugged into the dashboard server.
Creating an image of a physical CD or DVD
Media Connector page, no disc in drive.
Disc inserted into DVD-ROM.
Create image, confirmation screen.
Change image file name.
Image process starting.
Image created, uploading to Anvil! storage.
Upload complete.
Image listed in shared storage.
If your dashboard has a DVD or CD drive, insert your disc into it. If your dashboard does not have an optical drive, plug a USB drive in and insert your DVD or CD.
Once the disc has been inserted, refresh the Media Connector window and the "Upload" button will become available. Click on Upload to go to the confirmation page.
The label on the disk will be used to name the disc image file. Often this is a fairly cyptic name, so you can change the name if you wish. Once you are happy with the name, click on Confirm.
PLEASE BE PATIENT! This can take a while for anything to show up on your screen. Please give it some time.
After a bit, you will see a screen telling you that the image is being created. How long this takes to complete depends on the speed of the CD or DVD-ROM and the size of the disc being imaged.
Once the image has been created, it will be uploaded from the dashboard machine to the Anvil!. How long this takes will depend on the speed on the Back-Channel Network connection and the size of the image file.
Once the upload is complete, you will see Done!. Click on the back AN!CDB "Back" button to return to the Media Connector page.
On the main Media Connector page's Files already on the shared space section, you should see the image file you just created!
Downloading an Image From a Website or FTP Server
Download an ISO from a website or FTP server directly to shared storage
Media Connector page; Pasting the URL in the Address field.
Confirming the download.
The download is under way!
Download complete!
The downloaded image is now in the file list.
If you have an ISO image available for download from a website, you can pass the URL directly to Media Connector and it will connect to the address and download the image directly to the Anvil!'s shared storage. This is one of the most efficient ways to make CD/DVD images available to your servers.
Copy the website or FTP server address and paste it into the Address field and then click the Download button.
You will be asked to confirm the download. Note that, depending on the size of the image and the network speed, the download might take a long time to complete.
Once the download begins, a progress message will be displayed every 5% of the download.
Once the download is complete, you will see a summary of the download and a Done! message.
Click on the "Back" icon and you will see the new image in the file list!
Warning: Once the download starts, do not browse away from the download screen! Doing so could result in a partial download and unusable image file. If this happens, delete the file and download the file again.
Uploading an Image From Your Computer
Upload an ISO from your computer to shared storage.
Click on Browse to select a file from your computer.
Click on Upload and please be patient!
The upload screen eventually is displayed.
Upload complete!
The uploaded image is now in the file list.
There are two common cases where you will need to upload an ISO from your personal computer;
You created an image file of a CD or DVD using an application on your computer.
You had to download an ISO from a website that uses temporary, session-based links to ISO files.
In either case, you will need to upload the ISO file to your Anvil!'s shared storage.
Note: Browsers are very cautious about links that open your file browser. For this reason, when you click on Upload, it might take a while before the progress screen appears. Note in the second screen shot how the browser shows that the upload is in progress by showing a pin-wheel in the tab and a notification message at the bottom (other browsers will do some variation of this). Please be patient!
Click on the Browse button, locate the CD/DVD image file you wish to upload and select it. Once done, you will see the path to the file in the File field.
Click on the Upload button and the upload will begin. Note that it could take a while for the page to change!. The browser should show a message and an icon indicating that the upload is in progress.
After a time, the browser will refresh and an "in-progress" message will be displayed. Please continue to wait.
When the upload is complete, a message indicating this will be displayed.
Click on the "Back" icon and you will see the new image in the file list!
Warning: Once the upload starts, do not browse away from the download screen! Doing so could result in a partial download and unusable image file. If this happens, delete the file and download the file again.
Building Servers
This section will cover how to install various operating systems. The first one will use Microsoft's Windows 7. This first example will cover all of the installation steps in detail. The OS instructions after that will be somewhat condensed, so please review the Windows 7 install even if you plan to install a different operating system.
Building a Windows 7 Server
Connect to 'Virtual Machine Manager' and then click on Build a New Server
Double-click on Virtual Machine Manager.
Single-click on Build a New Server.
The "New Server" form.
Form fields filled out.
Installation started!
Connect to the new server's monitor using Virtual Machine Manager. Follow the operating system's installer just as you would on a bare-iron server.