TritonDataCenter / smartos-live

For more information, please see http://smartos.org/ For any questions that aren't answered there, please join the SmartOS discussion list: https://smartos.topicbox.com/groups/smartos-discuss
1.57k stars 246 forks source link

'hostname' and 'dns_domain' are not honered in LX zones when defined in JSON provisioning payload #514

Open cmacrae opened 8 years ago

cmacrae commented 8 years ago

When provisioning an LX branded zone (from any of the available LX images on the official Joyent dataset repository), attempts to set hostname and dns_domain seem to fail.

Here's an example payload:

{
    "brand": "lx",
    "image_uuid": "ffe82a0a-83d2-11e5-b5ac-f3e14f42f12d",
    "kernel_version": "3.19.0",
    "autoboot": true,
    "alias": "test",
    "zonename": "test",
    "hostname": "test.domain.tld",
    "dns_domain": "domain.tld",
    "resolvers": [
    "10.0.0.1"
    ],
    "max_physical_memory": 256,
    "max_swap": 256,
    "tmpfs": 256,
    "quota": 10,
    "nics": [
    {
        "nic_tag": "admin",
        "ip": "dhcp",
        "mac": "32:71:31:b3:08:1g"
    }
    ]
}

The above payload provisions an Ubuntu 15.04 zone.
When operating from this zone's shell, issuing hostname returns the intended test, but checking the FQDN with hostname -f simply returns localhost, when the expected output is test.domain.tld.

Furthermore; taking a look in /etc/resolv.conf, there is just a nameserver entry, but no search.
I have tried numerous combinations of setting this statically in the JSON payload and defining the admin NIC's IP settings so as not to attempt retrieval of this information from a DHCP server. Or using the option host-name "test.domain.tld"; in ISC DCHP and not setting it in the payload, or both, or a combination of all.

Attempted updates to these particular values using vmadm update are also futile.

Thanks in advance for any help on this, please do let me know if I can provide any more information.

rmustacc commented 8 years ago

@chorrell can you take a look at this and let us know if this is something that needs to be rigged up as part of the image or if this is something that lx needs to be explicitly doing in the brand set up hooks?

chorrell commented 8 years ago

Hi,

Yes, this is something that needs to be implemented in the images via the guest tools.

There's an open issue about hostname: https://github.com/joyent/sdc-vmtools-lx-brand/issues/6

Currently, there is some support for setting resolvers in lx-brand, not dns_domain.

https://github.com/joyent/illumos-joyent/blob/master/usr/src/lib/brand/lx/zone/lx_boot_zone_ubuntu.ksh#L33

The ability to set dns_domain should also be part of the guest tools.

Also, there's an RFD that is relevant here: https://github.com/joyent/rfd/blob/master/rfd/0015/README.md

The idea is to have a new, improved guest tools for the lx-brand images that handles a lot of the boot time actions (like setting meta-data values etc) rather than have things baked into the platform.

@cmacrae I'll open and issue for dns_domain and will work on getting that and setting the hostname added to the current guest tools.

chorrell commented 8 years ago

dns_domain issue: https://github.com/joyent/sdc-vmtools-lx-brand/issues/16

cmacrae commented 8 years ago

Thanks @chorrell :+1: