1. Installing Razor - Yes the New Version..
2. Razor - DHCP and TFTP
3. Installing the Razor client and creating a repository
4. Installers, Policies and Tags
5. Razor - What Lies Within the installer?
6. Installing ESXi with Razor
We are almost ready to deploy our first node but in order for that to happen - we will need the following.
razor repos "ESXi_5_1"
Create a broker. In our case - this will be the noop broker - which means that nothing will happen after the node has been provisioned.
razor create-broker --name=noop --broker-type=noop
razor brokers
Create a tag.
Before we go into how the tags are created - I would like to explain in a bit more detail, what the tags are used for.
The microkernel's main purpose is to scan the hardware of the node, and report that inventory back to the Razor server. With that information we can create categories/profiles/flavors of nodes - and deploy a operating to that node.
Let's take an example. You have a UCS Chassis. You want to deploy ESXi on the Blades that have 128GB of RAM, but on the UCS blades that have 64GB of RAM you don't want ESXi, but rather RHEL6. You also have an HP Chassis with 16 blades, and there you want to deploy ESXi on all the servers.
If we were to verbally describe the tags they would be as follows.
Tag | Rule |
UCS_ESXi | Physical server + Manufacturer is Cisco + Blade has exactly 128GB of RAM |
UCS_Redhat | Physical server + Manufacturer is Cisco + Blade has exactly 64GB of RAM |
HP_ESXi | Physical server + Manufacturer is HP |
VM_Ubuntu | Node is a VM + 1 vCPU + amount of RAM is <= 1GB |
For our example we will be creating a test rule and it's appropriate tag. The tag definitions will be:
cat > tag1.json << __CREATE_TAG_JSON___{
"name": "Test_tag",
"rule": ["and",
["=", ["num", ["fact", "processorcount"]], 2],
["=", ["fact", "is_virtual"], "true"],
[">=", ["num", ["fact", "memorysize_mb"]], 4096]
]
}__CREATE_TAG_JSON___
razor create-tag --json tag1.json
razor tags Test_tag
Now to create the policy.
cat > policy.json << __CREATE_POLICY_JSON___
{
"name": "ESXi_5_1",
"repo": { "name": "ESXi_5_1" },
"installer": { "name": "vmware_esxi" },
"broker": { "name": "noop" },
"enabled": true,
"hostname": "host${id}.maishsk.local",
"root_password": "blahblahbb5",
"max_count": "100",
"rule_number": "100",
"tags": [{ "name": "Test_tag"}]
}
__CREATE_POLICY_JSON___
The text above is piped to the policy.json file.
Let's go into a bit more detail into each of the lines of this policy.
razor create-policy --json policy.json
razor policies ESXi_5_1
The steps above were split into two stages, but there is also a possibility of creating the tag and the policy in the step, all you will need to do is define the rule in the policy.json - when the tag is declared.
Instead of this line
"tags": [{ "name": "Test_tag"}]
You could do the exact same thing without creating the tag beforehand with the following syntax (all should be on one line)
"tags": [ "name": "Test_tag", "rule": ["and",["=", ["num", ["fact", "processorcount"]], 2], ["=", ["fact", "is_virtual"], "true"], [">=", ["num", ["fact", "memorysize_mb"]], 4096]]]
The difference in the syntax above is that we defined the rule of the tag - during the creation of the policy.
That was a lot of information to digest in this post, so I hope you were able to get it all in.
In the next post - we will go into a little more detail about the installers and their configuration.