Code review comment for lp:~newell-jensen/maas/prefix-filter-virsh-bug-1393423

Revision history for this message
Newell Jensen (newell-jensen) wrote :

Example usage:

Let us suppose there is a MAAS profile login named `admin`. Let us also suppose that we have three virsh machines with the names node0, node1, and nokk that are on MAAS's network and can PXE boot etc. Additionally let us assume the username for the host is ubuntu and the password for this system is ubuntu as well, with an IP address of 10.0.0.2.

1. Get UUID of the cluster controller for the `admin` profile.

$ uuid=$(maas admin node-groups list | grep uuid | cut -d'"' -f4)

2. probe and enlist ALL virsh nodes.

$ maas admin node-group probe-and-enlist-hardware $uuid model=virsh power_address=qemu+ssh://ubuntu@10.0.0.2/system power_pass=ubuntu

The above command will enlist ALL the virsh nodes, which are the three noted above.
This shows that the probe and enlist still works as it should. Now let's add a prefix_filter parameter to the api command so that we only enlist the nodes that start with `node` (this prefix_filter can obviously be anything that you desire to filter on). Make sure to delete all you current nodes in MAAS so that we can do the probe and enlist again. Once that is complete-

3. probe and enlist nodes with prefix of `node`.

$ maas admin node-group probe-and-enlist-hardware $uuid model=virsh power_address=qemu+ssh://ubuntu@10.0.0.2/system power_pass=ubuntu prefix_filter=node

This will now only enlist the two nodes that begin with the prefix of `node`, node0 and node1.

« Back to merge proposal