Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7878233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:36:05+00:00 2026-06-03T03:36:05+00:00

I am managing vApps via the vCloud API(1.5) and the vCloud PHP SDK(1.5). I

  • 0

I am managing vApps via the vCloud API(1.5) and the vCloud PHP SDK(1.5).

I can start a stopped VM using the following below, however I am not sure how you can stop a running/deployed VM while reading the documentation. I see that you can invoke an action/powerOff, however I am not sure how you would do it within the SDK. Any help is appreciated!

<?php
    // This will start/turn on a vApp/VM. However, I cannot figure out how to turn it off from reading the documentation using the PHP SDK. Any help is appreciated!
    // login
    $service = VMware_VCloud_SDK_Service::getService();
    $service->login($server, array('username'=>$user, 'password'=>$pswd), $httpConfig);

    // create an SDK Org object
    $orgRefs = $service->getOrgRefs($orgName);
    if (0 == count($orgRefs))
    {
        exit("No organization with name $orgName is found\n");
    }
    $orgRef = $orgRefs[0];
    $sdkOrg = $service->createSDKObj($orgRef);

    // create an SDK vDC object
    $vdcRefs = $sdkOrg->getVdcRefs($vdcName);
    if (0 == count($vdcRefs))
    {
        exit("No vDC with name $vdcName is found\n");
    }
    $vdcRef = $vdcRefs[0];
    $sdkVdc = $service->createSDKObj($vdcRef);

    // get a reference to a vApp in the vDC
    $vAppRefs = $sdkVdc->getVAppRefs($vAppName);
    if (!$vAppRefs)
    {
        exit("No vApp with name $vAppName is found\n");
    }
    $vAppRef = $vAppRefs[0];
    // create an SDK vApp object
    $sdkVApp = $service->createSDKObj($vAppRef);

    // create a VMware_VCloud_API_DeployVAppParamsType data object
    $params = new VMware_VCloud_API_DeployVAppParamsType();
    $params->set_powerOn($powerOn);
    $params->set_deploymentLeaseSeconds($deploymentLeaseSeconds);

    // deploy the vApp
    $sdkVApp->deploy($params) 
<?php

References:

vCloud API Programming Guide
:
http://vmware.com/pdf/vcd_15_api_guide.pdf

vCloud SDK for PHP Developer’s Guide : http://www.vmware.com/pdf/vcd_15_sdk_php_dg.pdf

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:36:07+00:00Added an answer on June 3, 2026 at 3:36 am

    Use your $sdkVApp object:

    $sdkVApp->powerOff();
    

    Your $sdkVApp is of type VMware_VCloud_SDK_VApp.
    The powerOff function is defined in the parent abstract class VMWare_VCloud_SDK_VApp_Abstract. There are other functions in this abstract class such as suspend(), powerOn(), reset(), etc.

    The only thing I could not figure out yet is when using the powerOff() or suspend() function, the VApp gets powered Off or Suspended (shown in vCenter) but vCD shows the VM partially powered-off/suspended and the VApp still show Running.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have twisted managing rotating the log files for my application, however the
I'm managing a website that is built from the ground-up in PHP and uses
I have hard time managing children processes via signals and shared-memory (I know pipes
Managing url paths can be a real pain in ASP.NET. AbsolutePath vs RelativePath vs
•Managing Network Adapters Using GetAdaptersInfo •Managing Interfaces Using GetInterfaceInfo •Managing IP Addresses Using GetIpAddrTable
I'm managing a shared auth cookie when making WCF service calls via this methodology
Following SO thread shows Managing DLL references in multiple projects across different solutions .
I'm managing a project using trac. I have structured pages hierarchically and they look
Duplicate Managing date formats differences between PHP and MySQL PHP/MySQL: Convert from YYYY-MM-DD to
I'm managing an instance of Wordpress where the URLs are in the following format:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.