Regarding the "if ($self->provisioner->can("opennebula"))" code added to
the shutdown subroutines - it would be better to use the 'end_state'
argument passed to pre_capture.  There are cases such as this when a
provisioning module's capture subroutine doesn't want the OS to shutdown
the computer after the pre_capture tasks are done.  The 'end_state'
argument passed to pre_capture handles this.

Change 'off' to 'on in the following line in one.pm::capture should cause
pre_capture to return just before shutdown would be called:
if (!$self->os->pre_capture({end_state => 'off'})) --> if
(!$self->os->pre_capture({end_state => 'on'}))

You can then call $self->power_off from your provisioning module.

-Andy




On Thu, Sep 5, 2013 at 3:25 PM, Dmitri Chebotarov (JIRA) <[email protected]>wrote:

>
>     [
> https://issues.apache.org/jira/browse/VCL-722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13759339#comment-13759339]
>
> Dmitri Chebotarov commented on VCL-722:
> ---------------------------------------
>
> shutdown() in OS/Linux.pm and OS/Windows.pm shutdown computers via sending
> 'shutdown' command (over SSH session). When a VM shutdown this way,
> OpenNebula controller doesn't detect VM's state as SHUTDOWN and continue
> tagging VM as RUNNING.
> Image capture procedure in ONE relies on VM's status change from RUNNING
> to SHUTDOWN.
>
> I'm updating Linux.pm and Windows.pm to send ACPI shutdown to VMs via
> controller if VM provisioned using ONE module, i.e.
> if ($self->provisioner->can("opennebula")) { execute
> $self->provisioner->power_off()) }
>
> > OpenNebula module
> > -----------------
> >
> >                 Key: VCL-722
> >                 URL: https://issues.apache.org/jira/browse/VCL-722
> >             Project: VCL
> >          Issue Type: New Feature
> >          Components: vcld (backend)
> >    Affects Versions: 2.3
> >            Reporter: Dmitri Chebotarov
> >            Assignee: Dmitri Chebotarov
> >            Priority: Minor
> >
> > Allows VCL to provision to OpenNebula private cloud.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA
> administrators
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>

Reply via email to