Ok, I get your point. I believe though that the decision to create (or not) a SMF instance to start/stop a VM with SMF should be let to the user (admin). I mean, he might be interested to include some VMs in SMF, and not some other.
To satisfy this, I'm thinking more of a script that an admin would run explicitly to create/remove the associated instance (given an existing VM name) if he need to start the VM at boot time. Something like this: - Add SMF instance for VM vmname: vboxsmf -a vmname [ -s acpipowerbutton|savestate|acpisleepbutton|poweroff ] [ -u user ] [ -g group ] - Remove SMF instance for VM vmname: vboxsmf -r vmname - List vbox SMF instances (and status) (also list VM with no SMF instances?) vboxsmf -l Further administracion (enable, disable,...) would be done with svcadm and svccfg commands (not scripted). What do you think? I'd appreciate some more advice regarding an /issue/ I'm facing. At the momento the method and manifest are placed in my/the/a user home. Maybe it'd be better to place it in a system directory like /var/svc/manifest and /lib/svc/method. I have some more ideas to enhance the method, but I'll still have to research a bit if they can be done and how: VBoxManage returns immediatly, while the VM is just starting (or stopping) but isn't actually started/stopped. I'd like a way to get from the host some "OS heartbeat" from the guest OS (like VMware VMs with vmtools). That way the method could wait until the VM is started. Being that implemented, I could then define instance dependencies (at SMF level) to implement VM dependencies: vm2 dependent on vm1,... You know what I mean? Thanks, Alex On Wed, Sep 2, 2009 at 11:31 AM, Renaud Manus <Renaud.Manus at sun.com> wrote: > Alexandre Dumont a ?crit : > >> What do you mean exactly? Something like a wizard that get the list of VM >> from VBoxManage and create the corresponding instances in SMF? >> > > You need a way to automatically create the instances in SMF when you > create a new VM. The same when you delete a VM. One way to do it, is to > to create the VMs from the CLI using VBoxManage, so you get total > control on the process. Now you can create a wrapper script > (eg. CreateVM / DeleteVM) around VBoxManage to also create/delete the > corresponding SMF instances. > > -- Renaud > > >> On Wed, Sep 2, 2009 at 11:11 AM, Renaud Manus <Renaud.Manus at >> sun.com<mailto: >> Renaud.Manus at sun.com>> wrote: >> >> It looks much better now. >> >> Now, you just need a wrapper script around VBoxManage to create the VMs >> and the associated instances in SMF :-) >> >> Thanks >> -- Renaud >> >> Alexandre Dumont a ?crit : >> >> Hi, >> >> I've finally been able to work out an updated version of the >> manifest/method for my Virtualbox SMF service. This new version >> includes the corrections you suggested earlier in this thread, >> and others: >> >> - Handling multiple VMs: changed from contract model to >> transient because of how Virtualbox starts the VMs, >> - Service dependencies: new dependency on >> milestone/multi-user-server >> - Property value checking (in the method though, because I'm not >> familiar with Template Extensions and Value Constraints) >> - VM State checking before starting/stopping >> >> You can read more and download the files at >> http://adumont.serveblog.net/2009/09/01/virtualbox-smf-2/. >> >> Hope you find it useful, >> Regards, >> Alex >> >> On Wed, Jul 22, 2009 at 11:46 AM, Renaud Manus >> <Renaud.Manus at sun.com <mailto:Renaud.Manus at sun.com> >> <mailto:Renaud.Manus at sun.com <mailto:Renaud.Manus at sun.com>>> >> wrote: >> >> This is very good. >> >> A few comments : >> - The dependency on filesystem/local may not be sufficient if >> the >> VM's data are on a NFS filesytem for example. You might want to >> mimic what is done for Zones and add a dependency on >> milestone/multi-user-server >> >> - You don't check for the validity of the vm/stop_method >> property. >> You could either do it within the method or use the Value >> Constraints >> from the new feature recently introduced : Template >> Extensions[1] >> >> Regards, >> -- Renaud >> >> [1] http://opensolaris.org/os/project/vpanels/templates/ >> >> Alexandre Dumont wrote: >> >> Hi, >> >> I've written a manifest and method to start Virtualbox >> headless >> VMs at boot time. Both are explained in details at >> http://adumont.serveblog.net/2009/07/21/virtualbox-smf/. >> Feel >> free to comment me any further enhancement you may think of. >> Hope you find it useful. >> >> I'll be glad to have you publish it to "Converted services: >> manifests and methods" >> (http://www.opensolaris.org/os/community/smf/manifests/), >> should >> you think it deserves it of course. >> >> Best regards, >> Alex >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> smf-discuss mailing list >> smf-discuss at opensolaris.org >> <mailto:smf-discuss at opensolaris.org> >> <mailto:smf-discuss at opensolaris.org >> <mailto:smf-discuss at opensolaris.org>> >> >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/smf-discuss/attachments/20090902/78b3b056/attachment-0001.html>