Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a sizeable deployment of qemu/KVM VMs already, managed through libvirt. They're all CentOS 5 or 6 hosts and guests (the kernel lacks the 9p filesystem flags, so the "mount" shared filesystem won't work).

I'd like to pass an arbitrary string (or one or more key/value pairs, or a file, if that's easiest) from the host to the guest.

Requirements: 1) don't alter the networking setup (i.e. no host/guest local network and NFS on the host) 2) don't require new/custom kernels on the guests 3) Ideally, something we can do through libvirt. But that doesn't look possible, so this isn't required

Any ideas? I haven't been able to find much on this out there that doesn't fit into one of: 1) the "mount" filesystem stuff in the libvirt XML (as I said, CentOS lacks the 9p kernel flags, so this is a no-go) 2) NFS export on the host (which won't help at all unless I add a private network, which I can't) 3) The ugly hack to set the smbios serial number to... whatever arbitrary string.

share|improve this question
    
Do you need it to be static like when a guest is booted you don't expect to change it anymore? What about sshing to the guest and running some command?!? –  dsmsk80 Aug 30 '13 at 12:59
    
No, while we don't do migrations very often right now, I'd like it to actually know where it's running this instant. –  Jason Antman Oct 3 '13 at 12:18

1 Answer 1

the common practice it to start VMs with an attached VFD or iso that contains a configuration file.

...or to stop fooling around and install puppet/chef/spacewalk/saltstack etc.

...oooor to take up coding and write a custom VM agent that would interact with the host through the hypercall device. Afaik there have been some plans to allow such communication via qemu-ga, but I don't think it has been realised.

share|improve this answer
    
1) Unfortunately, yeah. It seems like that's the only logical solution. Sucks if all I want to pass in is one string. 2) We do use puppet. What the end result that I want is a vm_host fact on a guest that says what host it's running on. There are ways to do this the other way around, but they're all pretty ugly. 3) Yeah... looks like nobody is actually doing anything with vmchannel yet. Well thanks for the feedback/ideas... –  Jason Antman Sep 2 '13 at 15:36
    
RHEV agent uses vmchannel a lot, but it's for VM polling, not the other way around. The general understanding is that VMs shouldn't be aware of their VM-ness, and while polling them for information (like the current IP address) is OK, pushing stuff into them is not. Having said that, I've just recalled another project for openstack called vm_payload or somesuch, might be a fit for your needs –  dyasny Sep 2 '13 at 23:01
    
Thanks for the advice... though I probably won't get to do any more testing until this weekend. I understand the "VMs shouldnt be aware of their VM-ness", but I don't see how that's a plus from a management standpoint. I've got X-hundred VMs, it's useful for them to know where they're running, especially when I'm doing things like having puppet generate my monitoring configs, and I want the VM to know what physical host it's dependent on (at this instant). –  Jason Antman Sep 3 '13 at 10:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.