Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Provide identifying information in udhcpc requests #13

Open
mxk opened this issue Feb 10, 2016 · 3 comments
Open

Provide identifying information in udhcpc requests #13

mxk opened this issue Feb 10, 2016 · 3 comments

Comments

@mxk
Copy link

mxk commented Feb 10, 2016

I run dnsmasq as my DHCP server and it's configured to provide static leases to known MAC addresses. I don't want it handing out leases to unknown clients. Each Transfer VM instance has a unique local MAC, so no prefix that I can match, and no other identifying information (hostname, client id, enterprise vendor classes, etc.). It provides udhcp 1.12.4 as the vendor class, but that could match other hosts as well. This makes it impossible for me to configure dnsmasq to hand out dynamic IPs to Transfer VMs without also doing the same for all other hosts. Configuring a static IP for each import/export operation is a bit annoying.

Would it be possible to have each Transfer VM generate a dynamic hostname with a fixed prefix (e.g. transfervm-<random>) and provide some other unique identifier in the DHCP request?

As a workaround, is there some easy way for me to modify /sbin/hotplug on the Transfer VM template, which is where I think this change needs to be made? I tried poking around a running Transfer VM, but couldn't quite figure out what's stored where.

@Zhengchai
Copy link
Contributor

Hi Maxim

TransferVM is a hidden VM inside XenServer, its hostname is statically set during build. i.e. buildroot.config:BR2_HOSTNAME="transfervm". TVM uses DHCP to get IP address as you mentioned.

Regarding this case, could you pls help us to understand what is the customer’s real user cases to want a dynamic TVM hostname with a prefix?
If customer want to distinguish TVM instance, the XE command “xe vm-list” can list out the TVM, look its “name-label ( RW):”, each TVM has different name label can be used for this purpose indeed.

Regards

Zheng Chai
+86 186 5200 9228

From: Maxim Khitrov [mailto:notifications@github.com]
Sent: Thursday, February 11, 2016 7:01 AM
To: xenserver/transfervm transfervm@noreply.github.com
Subject: [transfervm] Provide identifying information in udhcpc requests (#13)

I run dnsmasq as my DHCP server and it's configured to provide static leases to known MAC addresses. I don't want it handing out leases to unknown clients. Each Transfer VM instance has a unique local MAC, so no prefix that I can match, and no other identifying information (hostname, client id, enterprise vendor classes, etc.). It provides udhcp 1.12.4 as the vendor class, but that could match other hosts as well. This makes it impossible for me to configure dnsmasq to hand out dynamic IPs to Transfer VMs without also doing the same for all other hosts. Configuring a static IP for each import/export operation is a bit annoying.

Would it be possible to have each Transfer VM generate a dynamic hostname with a fixed prefix (e.g. transfervm-) and provide some other unique identifier in the DHCP request?

As a workaround, is there some easy way for me to modify /sbin/hotplug on the Transfer VM template, which is where I think this change needs to be made? I tried poking around a running Transfer VM, but couldn't quite figure out what's stored where.


Reply to this email directly or view it on GitHubhttps://github.com//issues/13.

@mxk
Copy link
Author

mxk commented Feb 15, 2016

Right now the DHCP client doesn't send the hostname in the request at all, so it makes no difference. If you were to change that, I think it would make sense for different VMs to have different hostnames, especially since multiple transfer VMs can run in parallel.

The thing that I'm more interested in is having some identifying information in the request that would allow me to distinguish transfer VMs from other DHCP clients.

@Zhengchai
Copy link
Contributor

Hi Maxim

I believe what you need is to configure the dhcpclient in transfer VM to get the hostname – this shall be supported according to the DHCP protocol see https://tools.ietf.org/html/rfc1533#section-3.14
The DHCP client packed in Transfer VM is from Debian indeed, what you need to do is to modify the dhcpclient script to enable this – you may need a hook script.
Check out /etc/dhcp/dhclient.conf & /sbin/dhclient-script on Transfer VM please.

I believe you can get it. One example could also be found here: http://askubuntu.com/questions/104918/how-to-get-the-hostname-from-a-dhcp-server

Regards

Zheng Chai
+86 186 5200 9228

From: Maxim Khitrov [mailto:notifications@github.com]
Sent: Monday, February 15, 2016 11:33 PM
To: xenserver/transfervm transfervm@noreply.github.com
Cc: Zheng Chai zheng.chai@citrix.com
Subject: Re: [transfervm] Provide identifying information in udhcpc requests (#13)

Right now the DHCP client doesn't send the hostname in the request at all, so it makes no difference. If you were to change that, I think it would make sense for different VMs to have different hostnames, especially since multiple transfer VMs can run in parallel.

The thing that I'm more interested in is having some identifying information in the request that would allow me to distinguish transfer VMs from other DHCP clients.


Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-184255849.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants