VMware

This Question is Answered

1 "helpful" answer available (6 pts)
10 Replies Last post: Aug 10, 2009 10:30 AM by rdamos  

ConfigurationDeployEx Sample Code Needed posted: Jun 26, 2009 8:23 AM

Click to view cregan89's profile Novice 12 posts since
Jun 3, 2009
Could anybody send me some sample code using the ConfigurationDeployEx method? The standard ConfigurationDeploy method is not powerful enough to do what I need, but I can't get the ConfigurationDeployEx method to work no matter what I try. Preferably I need sample code in C# 2008. Thanks in advance.

Re: ConfigurationDeployEx Sample Code Needed

1. Jul 6, 2009 11:30 AM in response to: cregan89
Click to view stanbinev's profile Hot Shot 122 posts since
Feb 14, 2007

{size:10pt}Attached is a VisualStudio 2005 solution with one
project. The project consists of one nunit test case (which could easily be
converted to run in a console application. NUnit is also part of the zip
archive.)
{size}

{size:10pt} {size}

{size:10pt}The code does the
following:
{size}

{size:10pt}1.{font:Times New Roman}{size:1}{font:'Times New Roman'}{size:7pt}
{font}{font}Finds a configuration in the workspace. In my
test the configuration had one VM with one physical and two virtual
networks.

{font:Courier New}{size:2}{size:10pt}2.{font:Times New Roman}{size:1}{font:'Times New Roman'}{size:7pt}
{size}Captures it to the library

{font:Courier New}{size:10pt}3.{font:Times New Roman}{size:1}{font:'Times New Roman'}{size:7pt}
{font}{font}Checks it out from the library

{font:Courier New}{size:2}{size:10pt}4.{font:Times New Roman}{size:1}{font:'Times New Roman'}{size:7pt}
{size}Deploys it in fence mode (AllowAllInAndOut)
and it finds all physical and virtual networks that the configuration is
connected to and bridges all virtual networks to the primary physical
network.

{font:Courier New}{size:10pt} {size}

{size:10pt}Also attached is the network diagram after running the code{size}


Attachments:

Re: ConfigurationDeployEx Sample Code Needed

2. Jul 6, 2009 11:31 AM in response to: cregan89
Click to view stanbinev's profile Hot Shot 122 posts since
Feb 14, 2007

{size:10pt}Attached is a VisualStudio 2005 solution with one
project. The project consists of one nunit test case (which could easily be
converted to run in a console application. NUnit is also part of the zip
archive.)
{size}

{size:10pt} {size}

{size:10pt}The code does the
following:
{size}

{size:10pt}1.{font:Times New Roman}{size:1}{font:'Times New Roman'}{size:7pt}
{font}{font}Finds a configuration in the workspace. In my
test the configuration had one VM with one physical and two virtual
networks.

{font:Courier New}{size:2}{size:10pt}2.{font:Times New Roman}{size:1}{font:'Times New Roman'}{size:7pt}
{size}Captures it to the library

{font:Courier New}{size:10pt}3.{font:Times New Roman}{size:1}{font:'Times New Roman'}{size:7pt}
{font}{font}Checks it out from the library

{font:Courier New}{size:2}{size:10pt}4.{font:Times New Roman}{size:1}{font:'Times New Roman'}{size:7pt}
{size}Deploys it in fence mode (AllowAllInAndOut)
and it finds all physical and virtual networks that the configuration is
connected to and bridges all virtual networks to the primary physical
network.

{font:Courier New}{size:10pt} {size}

{size:10pt}After running the code in lab manager I get this network
diagram for the deployed configuration:
{size}

Attachments:

Re: ConfigurationDeployEx Sample Code Needed

3. Jul 6, 2009 11:32 AM in response to: cregan89
Click to view stanbinev's profile Hot Shot 122 posts since
Feb 14, 2007
I don't know why the posting has gotten a bit distorted but you should still be able to use the samle code.

Re: ConfigurationDeployEx Sample Code Needed

5. Jul 7, 2009 1:14 PM in response to: cregan89
Click to view stanbinev's profile Hot Shot 122 posts since
Feb 14, 2007
Can you provide more information on this? What physical and virtual networks do you have in the system (screenshot of the network list page will be nice)? The code snippet that tries to get a list of the networks?

Re: ConfigurationDeployEx Sample Code Needed

7. Jul 8, 2009 1:12 PM in response to: cregan89
Click to view stanbinev's profile Hot Shot 122 posts since
Feb 14, 2007

So far:

1. Make sure that the user you are using has access to the configuration and networks.

2. Make sure that the physical network is added to the configuration network page (attachment to follow)

3. Make sure that the configuration has one or more NICs.

Attachments:

Re: ConfigurationDeployEx Sample Code Needed

9. Jul 14, 2009 1:37 PM in response to: cregan89
Click to view stanbinev's profile Hot Shot 122 posts since
Feb 14, 2007

I am guessing you are using VS 2008. Attached is a tiny example of a VS2008 client to the SOAP API. Regardless of which version you are using or how the proxy classes are created, you will need to massage the client code to make use of those proxy classes generated for you by VS.

Good luck!

Attachments:

Re: ConfigurationDeployEx Sample Code Needed

10. Aug 10, 2009 10:30 AM in response to: stanbinev
Click to view rdamos's profile Novice 9 posts since
Nov 23, 2004

We had the same problem. We have only an internal network in the configuration. When we deploy we connect the virtual to the physical network 'Teleservice Portal Desktops'. Therefore we had to retrieve the physical network ID from LM with GetNetworkTemplateByName.

Also, make sure to set the FenceNetworkOptios to NULL, otherwise you have an exception.

Richard

Attachments:

Developer Social Media

Communities