OpenSolaris

Discussions Communities Projects Download Source Browser

Home » OpenSolaris Forums » smf » discuss

Thread: [smf-discuss] SMF manifest and method for Sun xVM Virtualbox

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 7 - Last Post: Sep 2, 2009 7:21 AM by: adumont
adumont

Posts: 12
From: Madrid, Spain

Registered: 4/2/09
[smf-discuss] SMF manifest and method for Sun xVM Virtualbox
Posted: Jul 21, 2009 3:18 PM

  Click to reply to this thread Reply

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 dot org

rmanus

Posts: 500
From:

Registered: 9/26/06
Re: [smf-discuss] SMF manifest and method for Sun xVM Virtualbox
Posted: Jul 22, 2009 2:46 AM   in response to: adumont

  Click to reply to this thread Reply

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 dot org
_______________________________________________
smf-discuss mailing list
smf-discuss at opensolaris dot org


adumont

Posts: 12
From: Madrid, Spain

Registered: 4/2/09
Re: [smf-discuss] SMF manifest and method for Sun xVM Virtualbox
Posted: Jul 29, 2009 3:38 PM   in response to: rmanus

  Click to reply to this thread Reply

Thanks for the comments. I'm working on 2nd revision of the manifest and method, in which I'll integrate this corrections and some other. I'll let you know.

On Wed, Jul 22, 2009 at 11:46 AM, Renaud Manus <Renaud dot Manus at sun dot 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 dot org

_______________________________________________ smf-discuss mailing list smf-discuss at opensolaris dot org

adumont

Posts: 12
From: Madrid, Spain

Registered: 4/2/09
Re: [smf-discuss] SMF manifest and method for Sun xVM Virtualbox
Posted: Sep 1, 2009 3:42 PM   in response to: rmanus

  Click to reply to this thread Reply

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 dot Manus at sun dot 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 dot org

_______________________________________________ smf-discuss mailing list smf-discuss at opensolaris dot org

rmanus

Posts: 500
From:

Registered: 9/26/06
Re: [smf-discuss] SMF manifest and method for Sun xVM Virtualbox
Posted: Sep 2, 2009 2:11 AM   in response to: adumont

  Click to reply to this thread Reply

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 dot Manus at sun dot com
> <mailto:Renaud dot Manus at sun dot 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 dot org <mailto:smf-discuss at opensolaris dot org>
>
>
_______________________________________________
smf-discuss mailing list
smf-discuss at opensolaris dot org


adumont

Posts: 12
From: Madrid, Spain

Registered: 4/2/09
Re: [smf-discuss] SMF manifest and method for Sun xVM Virtualbox
Posted: Sep 2, 2009 2:17 AM   in response to: rmanus

  Click to reply to this thread Reply

What do you mean exactly? Something like a wizard that get the list of VM from VBoxManage and create the corresponding instances in SMF?

On Wed, Sep 2, 2009 at 11:11 AM, Renaud Manus <Renaud dot Manus at sun dot 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 dot Manus at sun dot com <mailto:Renaud dot Manus at sun dot 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 dot org <mailto:smf-discuss at opensolaris dot org>



_______________________________________________ smf-discuss mailing list smf-discuss at opensolaris dot org

rmanus

Posts: 500
From:

Registered: 9/26/06
Re: [smf-discuss] SMF manifest and method for Sun xVM Virtualbox
Posted: Sep 2, 2009 2:31 AM   in response to: adumont

  Click to reply to this thread Reply

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 dot Manus at sun dot com
> <mailto:Renaud dot Manus at sun dot 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 dot Manus at sun dot com <mailto:Renaud dot Manus at sun dot com>
> <mailto:Renaud dot Manus at sun dot com <mailto:Renaud dot Manus at sun dot 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 dot org
> <mailto:smf-discuss at opensolaris dot org>
> <mailto:smf-discuss at opensolaris dot org
> <mailto:smf-discuss at opensolaris dot org>>
>
>
>
_______________________________________________
smf-discuss mailing list
smf-discuss at opensolaris dot org


adumont

Posts: 12
From: Madrid, Spain

Registered: 4/2/09
Re: [smf-discuss] SMF manifest and method for Sun xVM Virtualbox
Posted: Sep 2, 2009 7:21 AM   in response to: rmanus

  Click to reply to this thread Reply

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 dot Manus at sun dot 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 dot Manus at sun dot com <mailto:Renaud dot Manus at sun dot 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 dot Manus at sun dot com <mailto:Renaud dot Manus at sun dot com>
       <mailto:Renaud dot Manus at sun dot com <mailto:Renaud dot Manus at sun dot 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 dot org
       <mailto:smf-discuss at opensolaris dot org>
       <mailto:smf-discuss at opensolaris dot org
       <mailto:smf-discuss at opensolaris dot org>>




_______________________________________________ smf-discuss mailing list smf-discuss at opensolaris dot org




Terms of Use | Privacy | Trademarks | Copyright Policy | Site Guidelines
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
Copyright © 1995-2005 Sun Microsystems, Inc.