MAAS CLI should not require mac when creating virsh hosts

Bug #1910812 reported by Alexander Balderson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Won't Fix
Wishlist
Unassigned

Bug Description

When adding a machine with a virsh power_type, maas should be able to lookup the mac address for the node itself, instead of being provided by the user at creation.

I believe the requirement was removed from https://bugs.launchpad.net/maas/+bug/1707216 and the docs for the UI dont have mac listed https://maas.io/docs/bmc-power-types#heading--example-virsh-kvm-power-type
however when trying to add a host from the CLI, maas errors because there is no mac:

$ maas root machines create hostname=node1 power_type=virsh architecture=amd64/generic power_parameters_power_address=qemu+ssh://ubuntu@10.244.40.1/system zone=zone2 power_parameters_power_id=node1 testing_scripts=none

{"mac_addresses": ["This field is required."]}

This error was produced from the maas snap 2.8.2-8577-g.a3e674063 and maas-cli snap 0.6.5

The mac information can be easily gathered with the virsh command:

"virsh -c $BMC domiflist $VMNAME |head -n 3|tail -n 1|awk '{print $5}'"

summary: - MaaS CLI should not require mac when creating vrish hosts
+ MaaS CLI should not require mac when creating virsh hosts
Revision history for this message
Lee Trager (ltrager) wrote :

When a new IPMI machine without a MAC address boots MAAS detects the BMC with ipmitools in the booted ephemeral environment. That information is then sent to MAAS which maps it to an exiting machine. Once the mapping takes place network information is sent which is added to the mapped machine.

There is no way for MAAS to look up virsh information within the VM which is how it works with IPMI. Because of this a MAC address is required.

Marking this as wish list since we could interact with virsh before powering a machine is on but this isn't something MAAS currently has a code path for.

Changed in maas:
importance: Undecided → Wishlist
Revision history for this message
Alexander Balderson (asbalderson) wrote :

But the maas GUI doesn't require the mac information. Is the GUI making a different request than the CLI would make when adding a virsh node?

https://maas.io/docs/bmc-power-types#heading--example-virsh-kvm-power-type

Additionally doesn't maas make a virsh command to power on a virsh node when required? So it must have access to virsh console to make the call.

There is even a function which makes the call for the mac address in the virsh hardware drivers:

https://git.launchpad.net/maas/tree/src/provisioningserver/drivers/hardware/virsh.py#n174

Alberto Donato (ack)
Changed in maas:
status: New → Triaged
summary: - MaaS CLI should not require mac when creating virsh hosts
+ MAAS CLI should not require mac when creating virsh hosts
Revision history for this message
Adam Collard (adam-collard) wrote :

This is a complex deep rooted change in MAAS - we note that the UI does require a MAC address when adding a new machine, it's only when editing an existing VM's power configuration that the MAC address field isn't shown (as in the linked docs)

Changed in maas:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.