vCloud SDK for .NET Programming Guide - .vCloud SDK for .NET Developer’s Guide...

download vCloud SDK for .NET Programming Guide - .vCloud SDK for .NET Developer’s Guide VMware vCloud SDK

of 22

  • date post

    06-Jun-2018
  • Category

    Documents

  • view

    229
  • download

    0

Embed Size (px)

Transcript of vCloud SDK for .NET Programming Guide - .vCloud SDK for .NET Developer’s Guide...

  • vCloud SDK for .NET Developers GuideVMware vCloud SDK 1.0

    This document supports the version of each product listed andsupports all subsequent versions until the document is replacedby a new edition. To check for more recent editions of thisdocument, see http://www.vmware.com/support/pubs.

    EN-000470-00

    http://www.vmware.com/support/pubs

  • VMware, Inc.3401 Hillview Ave.Palo Alto, CA 94304www.vmware.com

    2 VMware, Inc.

    vCloud SDK for .NET Developers Guide

    You can find the most up-to-date technical documentation on the VMware Web site at:

    http://www.vmware.com/support/

    The VMware Web site also provides the latest product updates.

    If you have comments about this documentation, submit your feedback to:

    docfeedback@vmware.com

    Copyright 2010 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents.

    VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies.

    http://www.vmware.com/support/http://www.vmware.com/supportmailto:docfeedback@vmware.comhttp://www.vmware.com/go/patentshttp://www.vmware.com/go/patents

  • VMware, Inc. 3

    Contents

    AboutThisBook 5

    1 AboutthevCloudSDKfor.NET 7vCloudObjectTaxonomy 7vCloudSDKfor.NETDesign 9

    2 SettingUpfor .NETDevelopment 11Prerequisites 11DownloadandInstallthevCloudSDKfor.NET 12

    3 HellovCloud:AStructuredWorkflowExample 13RunningtheHellovCloudExample 13LoggingInandGettinganOrganizationList 14GettingReferencestothevDCandCatalog 14UploadanOVFPackagetoCreateavAppTemplate 14AddthevAppTemplatetoaCatalog 16InstantiatethevAppTemplate 16OperatethevApp 17

    4 UsingtheExamples 19BuildingtheExamples 19RunningtheExamples 19

    Index 21

  • vCloud SDK for .NET Developers Guide

    4 VMware, Inc.

  • VMware, Inc. 5

    Thisbook,thevCloudSDKfor.NETDevelopersGuide,providesinformationaboutusingtheVMware vCloud

    SDKfor .NET.

    VMwareprovidesseveralAPIsandSDKsfordifferentapplicationsandgoals.ThisbookprovidesinformationaboutusingthevCloudSDKfor.NETfordeveloperswhoarecreatingVMwarevCloudDirectorclientapplicationsinC#usingthe .NETframework.

    ToviewthecurrentversionofthisbookaswellasallVMwareAPIandSDKdocumentation,gotohttp://www.vmware.com/support/pubs/sdk_pubs.html.

    Revision HistoryThisguideisrevisedwitheachreleaseoftheproductorwhennecessary.Arevisedversioncancontainminorormajorchanges.Table 1summarizesthesignificantchangesineachversionofthisguide.

    Intended AudienceThisguideisintendedforsoftwaredeveloperswhoarebuildingvCloudAPIapplications,includinginteractiveclientsofVMwareCloudDirector.ThisguideassumesyouarefamiliarwiththeC#programminglanguage,the .NETframework,RepresentationalStateTransfer(REST)andRESTfulprogrammingconventions,theOpenVirtualizationFormat(OVF)Specification,andVMwarevirtualmachinetechnology.FamiliaritywithothertechnologiessuchasXML,HTTP,andtheWindowsorLinuxoperatingsystemsisalsoassumed.

    VMware Technical Publications GlossaryVMwareTechnicalPublicationsprovidesaglossaryoftermsthatmightbeunfamiliartoyou.FordefinitionsoftermsastheyareusedinVMwaretechnicaldocumentationgotohttp://www.vmware.com/support/pubs.

    Document FeedbackVMwarewelcomesyoursuggestionsforimprovingourdocumentation.Sendyourfeedbacktodocfeedback@vmware.com.

    About This Book

    Table 1. Revision History

    Revision Description

    01NOV10 Version1.0.AmendmentsandminorcorrectionstoBetacontent.

    29SEP10 Version1.0(Beta)

    http://www.vmware.com/support/pubs/sdk_pubs.htmlhttp://www.vmware.com/support/pubsmailto:docfeedback@vmware.commailto:docfeedback@vmware.com

  • vCloud SDK for .NET Developers Guide

    6 VMware, Inc.

    Technical Support and Education ResourcesThefollowingsectionsdescribethetechnicalsupportresourcesavailabletoyou.ToaccessthecurrentversionsofotherVMwarebooks,gotohttp://www.vmware.com/support/pubs.

    Online and Telephone SupportTouseonlinesupporttosubmittechnicalsupportrequests,viewyourproductandcontractinformation,andregisteryourproducts,gotohttp://communities.vmware.com/community/developer.

    Support OfferingsTofindouthowVMwaresupportofferingscanhelpmeetyourbusinessneeds,gotohttp://www.vmware.com/support/services.

    VMware Professional ServicesVMwareEducationServicescoursesofferextensivehandsonlabs,casestudyexamples,andcoursematerialsdesignedtobeusedasonthejobreferencetools.Coursesareavailableonsite,intheclassroom,andliveonline.Foronsitepilotprograms andimplementationbestpractices,VMwareConsultingServicesprovidesofferingsto helpyouassess,plan,build,andmanageyourvirtualenvironment.Toaccessinformationabouteducationclasses,certificationprograms,andconsultingservices,gotohttp://www.vmware.com/services.

    http://www.vmware.com/support/pubshttp://communities.vmware.com/community/developerhttp://www.vmware.com/support/serviceshttp://www.vmware.com/services/

  • VMware, Inc. 7

    1

    TheVMwarevCloudAPIprovidessupportfordeveloperswhoarebuildinginteractiveclientsofVMwarevCloudDirectorusingaRESTfulapplicationdevelopmentstyle.vCloudAPIclientsandserverscommunicateoverHTTP,exchangingrepresentationsofvCloudobjects.TheserepresentationstaketheformofXMLelements.HTTPGETrequestsareusedtoretrievethecurrentrepresentationofanobject,HTTPPOSTandPUTrequestsareusedtocreateormodifyanobject,andHTTPDELETErequestsaretypicallyusedtodeleteanobject.

    ThevCloudSDKfor.NETisaC#languagebindingforthevCloudAPI.ItprovidesC#classlibrariesandasetofexampleapplications.Theclassesandfunctionsinthelibraryencapsulatetheinterfaces,objects,andoperationsthatthevCloudAPIsupports,whilepreservingitsRESTfulapproachandcompatibilitywiththeHTTPprotocolfamily.

    ThisvCloudSDKfor.NETDevelopersGuideprovidesinformationaboutsettinguptheSDKinadevelopmentenvironment,andinformationaboutbuildingandrunningtheexampleapplicationsincludedintheSDK.

    Thischapterincludesthefollowingtopics:

    vCloudObjectTaxonomyonpage 7

    vCloudSDKfor.NETDesignonpage 9

    vCloud Object TaxonomyThevCloudSDKfor.NETdefinesasetofobjectscommontocloudcomputingenvironments.Figure 11showstheprincipalobjecttypes.

    vCloud OrganizationsAvCloudcontainsoneormoreorganizations.AvCloudorganizationisaunitofadministrationforacollectionofusers,groups,andcomputingresources.Usersauthenticateattheorganizationlevel,supplyingcredentialsestablishedbyanorganizationadministratorwhentheuserwascreatedorimported.

    vCloud Users and Groups

    Anorganizationcancontainanarbitrarynumberofusersandgroups.UserscanbecreatedbytheorganizationadministratororimportedfromadirectoryservicesuchasLDAP.Groupsmustbeimportedfromthedirectoryservice.Permissionswithinanorganizationarecontrolledthroughtheassignmentofrightsandrolestousersandgroups.

    vCloud Networks

    Anorganizationcanbeprovisionedwithoneormorenetworks.TheseorganizationnetworkscanbeconfiguredtoprovideservicessuchasDHCP,NAT,andfirewalls.

    About the vCloud SDK for .NET 1

  • vCloud SDK for .NET Developers Guide

    8 VMware, Inc.

    Figure 1-1. vCloud Object Taxonomy

    vCloud Virtual Datacenters

    AvCloudvirtualdatacenter(vDC)isanallocationmechanismforresourcessuchasnetworks,storage,CPU,andmemory.InavDC,computingresourcesarefullyvirtualized,andcanbeallocatedbasedondemand,servicelevelrequirements,oracombinationofthetwo.

    TherearetwokindsofvDCs:

    ProvidervDCs.ThesevDCscontainalltheresourcesavailablefromthevCloudserviceprovider.ProvidervDCsarecreatedandmanagedbyvCloudsystemadministrators.

    OrganizationvDCs.ThesevDCsprovideanenvironmentwherevirtualsystemscanbestored,deployed,andoperated.Theyalsoprovidestorageforvirtualmedia,suchasfloppydisksandCDROMs.

    AnorganizationadministratorspecifieshowresourcesfromaprovidervDCaredistributedtothevDCsinanorganization.

    vCloud Catalogs

    Catalogscontainreferencestovirtualsystemsandmediaimages.Acatalogcanbesharedtomakeitvisibletoothermembersofanorganization,andcanbepublishedtomakeitvisibletootherorganizations.AvCloudsystemadministratorspecifieswhichorganizationscanpublishcatalogs,andanorganizationadministratorcontrolsaccesstocatalogsbyorganizationmembers.

    vCloud Tasks

    Longrunningoperationsinitiatedbymembersofanorganizationcreatetasks,whicharekeptontheorganizationstaskslist.

    Catalog 2Catalogitem

    ememem

    Catalog 1

    Catalog 3

    vDC2 CatalogitemCatalogitemCatalogitemCatalogitem

    users

    Media

    vApptemplate

    Media

    vApp

    TasksList

    Organization

    vDC1

    Media

    vApptemplate

    Media

    vApp

    NetworkNetwork

    Catalogitemememem

    groups

  • VMware, Inc. 9

    Chapter 1 About the vCloud SDK for .NET

    Virtual Systems and Media Images in a vCloud

    VirtualsystemsandmediaimagesarestoredinavDCandcanbeincludedinacatalog.Mediaimagesarestoredintheirnativerepresentation(ISOorfloppy).Virtualsystemsarestoredastemplates,usinganopenstandardformat(OVF1.0).Thesetemplatescanberetrievedfromcatalogsandtransformedintovirtualsystems,calledvApps,throughaprocesscalledinstantiation,whichbindsatemplatesabstractresourcerequirementstoresourcesavailableinavDC.AvAppcontainsoneormoreindividualvirtualmachines(Vmelements),alongwithparametersthatdefineoperationaldetailssuchas:

    Howthecontainedvirtualmachinesareconnectedtoeachotherandtoexternalnetworks.

    Theorderinwhichindividualvirtualmachinesarepoweredonoroff.

    Enduserlicenseagreementtermsforeachvirtualmachine.

    Deploymentleaseterms(typicallyinheritedfromthecontainingorganization)thatconstrainthevAppsconsumptionofvDCresources

    Accesscontrolinformationspecifyingwhichusersandgroupscanperformoperationssuc