Merge lp:~newell-jensen/maas/prefix-filter-virsh-bug-1393423 into lp:~maas-committers/maas/trunk
Proposed by
Newell Jensen
Status: | Merged |
---|---|
Approved by: | Newell Jensen |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3404 |
Proposed branch: | lp:~newell-jensen/maas/prefix-filter-virsh-bug-1393423 |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
332 lines (+113/-18) 9 files modified
src/maasserver/api/node_groups.py (+6/-1) src/maasserver/api/tests/test_nodegroup.py (+70/-0) src/maasserver/models/nodegroup.py (+4/-2) src/maasserver/models/tests/test_nodegroup.py (+5/-2) src/provisioningserver/drivers/hardware/tests/test_virsh.py (+11/-4) src/provisioningserver/drivers/hardware/virsh.py (+9/-4) src/provisioningserver/rpc/cluster.py (+1/-0) src/provisioningserver/rpc/clusterservice.py (+2/-2) src/provisioningserver/rpc/tests/test_clusterservice.py (+5/-3) |
To merge this branch: | bzr merge lp:~newell-jensen/maas/prefix-filter-virsh-bug-1393423 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Blake Rouse (community) | Approve | ||
Review via email: mp+243569@code.launchpad.net |
Commit message
This branch gives the user the capability to add an optional `prefix_filter` parameter to the api call for probe_and_
To post a comment you must log in.
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.