fog / fog-xenserver

Module for the 'fog' gem to support XENSERVER
MIT License
16 stars 22 forks source link

Create VIF with MAC #42

Closed fmbiete closed 9 years ago

fmbiete commented 9 years ago

Hi,

I'm trying to create a VIF with a custom MAC address (since later is not possible to change it). But the mac address is silently discarded:

connection.vifs.create(server: vm_object, network: network_object, MAC: 'mac address')
connection.vifs.create(server: vm_object, network: network_object, mac: 'mac address')

Both will create a vif but with autogenerated MAC.

brent-c-mills commented 9 years ago

Is there a reason you want a specific MAC address? You can query by VM name / uuid and return the generated one. You just do:

server = connection.servers.find { |server| server.uuid == #{uuid} } Mac = server.vifs.mac.first

Sent from my iPhone

On Mar 6, 2015, at 6:42 AM, Francisco Miguel Biete notifications@github.com wrote:

Hi,

I'm trying to create a VIF with a custom MAC address (since later is not possible to change it). But the mac address is silently discarded:

connection.vifs.create(server: vm_object, network: network_object, MAC: 'mac address') connection.vifs.create(server: vm_object, network: network_object, mac: 'mac address') Both will create a vif but with autogenerated MAC.

\ Reply to this email directly or view it on GitHub.

fmbiete commented 9 years ago

Yes, I need to use a specific MAC because I will be using a static DHCP server, and the MAC will tell some attributes (DNS, gateway...). For example if the MAC starts with 02:01 thats CPD 02 client 01, use their config.

plribeiro3000 commented 9 years ago

@fmbiete I'm not sure the reason behind this. When using fog i had this same behavior so i guess it was just extracted as well. Perhaps you have time to dig it further?

fmbiete commented 9 years ago

The problem was that I only had fog in my Gemfile, adding fog-xenserver fixes the xenserver support in fog, and the MAC is added at creation time.

Sorry for this.

plribeiro3000 commented 9 years ago

@fmbiete. Awesome to know. Thanks