You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by "Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)" <mp...@cisco.com> on 2014/04/07 08:59:28 UTC

ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi,

I am using Stratos over vCloud0-Director.

I am able to subscribe to the cartridge from stratos-cli & the VM is getting created on the vCloud-Director but it remains in Powered-Off state. Thereafter multiple-vms are getting spawned. When I manually power-on the Cartridge-VM, it fails to get network configuration & comes up without IP Address.

Please suggest.


Regards
Manas

RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by "Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)" <mp...@cisco.com>.
Hi Sajith & Isuru

Attached are the wso2carbon logs.

In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at Edge-GW which is an interface to outside world(5.5.5.0/24 i/e/ floating IP NW)


Regards
Manas

From: Sajith Kariyawasam [mailto:sajith@wso2.com]
Sent: Monday, April 07, 2014 3:17 PM
To: dev@stratos.incubator.apache.org
Subject: Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi Manas,

Did you check the stratos log file? If you can please share the log file found in <Stratos>/repository/logs/wso2carbon.log

Thanks,
Sajith

On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>> wrote:
Hi,

I am using Stratos over vCloud0-Director.

I am able to subscribe to the cartridge from stratos-cli & the VM is getting created on the vCloud-Director but it remains in Powered-Off state. Thereafter multiple-vms are getting spawned. When I manually power-on the Cartridge-VM, it fails to get network configuration & comes up without IP Address.

Please suggest.


Regards
Manas



--
Sajith Kariyawasam
Senior Software Engineer; WSO2, Inc.
AMIE (SL)
Blog: http://sajithblogs.blogspot.com/
Mobile: +94772269575

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Melan Nimesh <me...@apache.org>.
Hi Manas,

DHCP based IP assignment is still an untested scenario on Stratos with
vCloud. We are currently looking into it and we will update the thread as
progress.

Thanks,
Melan


On Wed, Apr 9, 2014 at 10:44 AM, Manas Padegaonkar -T (mpadegao - ARICENT
TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:

>  Hi Isuru,
>
>
>
> I am able to move one step ahead & now VM Cartridges are getting
> Powered-ON & an IP is allocated to them after they got launch by Stratos.
>
> But I am not convinced with the work-around/configuration-changes after
> which this happens. We did only one change as mentioned below:---
>
>
>
> "Defined Static-Pool of IPs in the Organization VDC
> Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are
> using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)"
>
>
>
> The strange part is that on the vCloud-Director Web-Console, VM-Cartridge
> IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240 but inside
> VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool i.e.
> 6.6.6.10-6.6.6.200.
>
>
>
> Attaching screenshot of vCloud-Director.
>
>
>
> Regards
>
> Manas
>
>
>
>
>
>
>
> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
> LIMITED at Cisco)
> *Sent:* Tuesday, April 08, 2014 3:22 PM
> *To:* Isuru Perera; dev
>
> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is
> Getting Created But Not Powered-On By Stratos
>
>
>
> Hi Isuru,
>
>
>
> I went through this troubleshooting guide yesterday & we have sufficient
> IPs available in the dhcp pool.
>
> I never get any error whenever I manually launch the VMs under the same
> Organization VDC.
>
>
>
> Regards
>
> Manas
>
>
>
> *From:* Isuru Perera [mailto:isurup@wso2.com <is...@wso2.com>]
> *Sent:* Tuesday, April 08, 2014 1:04 PM
> *To:* dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
> LIMITED at Cisco)
> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is
> Getting Created But Not Powered-On By Stratos
>
>
>
> Hi Manas,
>
> I analyzed the logs.
>
> Could you please check why following error appears?
>
> "There are insufficient IP addresses to complete operation. You need to
> add IP addresses to the network that is associated with the object being
> created or deployed"
>
> Please check following.
>
>
> http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
>
> Possible solution according to docs:
>
> * Assign additional IP addresses to the network where the application is
> being deployed.
>
> * Delete unwanted deployments from vFabric Application Director to free
> some IP addresses and storage space.
>
> Please check and let us know.
>
> Thanks!
>
>
>
> On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao - ARICENT
> TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:
>
> Hi Isuru & Sajith,
>
>
>
> More detailed logs are attached herewith. Awaiting your reply.
>
>
>
> Regards
>
> Manas
>
>
>
> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
> LIMITED at Cisco)
> *Sent:* Monday, April 07, 2014 5:21 PM
> *To:* dev@stratos.incubator.apache.org
> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is
> Getting Created But Not Powered-On By Stratos
>
>
>
> Hi Sajith & Isuru
>
>
>
> Attached are the wso2carbon logs.
>
>
>
> In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC
> Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at Edge-GW
> which is an interface to outside world(5.5.5.0/24 i/e/ floating IP NW)
>
>
>
>
>
> Regards
>
> Manas
>
>
>
> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com <sa...@wso2.com>]
> *Sent:* Monday, April 07, 2014 3:17 PM
> *To:* dev@stratos.incubator.apache.org
> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is
> Getting Created But Not Powered-On By Stratos
>
>
>
> Hi Manas,
>
>
>
> Did you check the stratos log file? If you can please share the log file
> found in <Stratos>/repository/logs/wso2carbon.log
>
>
>
> Thanks,
>
> Sajith
>
>
>
> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao - ARICENT
> TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:
>
> Hi,
>
>
>
> I am using Stratos over vCloud0-Director.
>
>
>
> I am able to subscribe to the cartridge from stratos-cli & the VM is
> getting created on the vCloud-Director but it remains in Powered-Off state.
> Thereafter multiple-vms are getting spawned. When I manually power-on the
> Cartridge-VM, it fails to get network configuration & comes up without IP
> Address.
>
>
>
> Please suggest.
>
>
>
>
>
> Regards
>
> Manas
>
>
>
>
>
> --
>
> *Sajith Kariyawasam*
>
> *Senior Software Engineer; WSO2, Inc.*
>
> *AMIE (SL)*
>
> *Blog: http://sajithblogs.blogspot.com/ <http://sajithblogs.blogspot.com/>*
>
> *Mobile: +94772269575 <%2B94772269575>*
>
>
>
>
> --
>
> Isuru Perera
> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> about.me/chrishantha
>



-- 
Melan Nimesh Jayasinghage

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Melan Nimesh <me...@apache.org>.
HI All,

Unfortunately, faced an issue while testing due to race condition between
IP assignment and launching of vCloud customization script, basically
launching vCloud customization script need a IP to be assigned, but there
is a delay in DHCP IP assignment in vCloud environment and jclouds fails at
that point. I am currently looking into it

Thanks,
Melan


On Thu, Apr 17, 2014 at 11:06 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Thanks Melan!
>
>
> On Thu, Apr 17, 2014 at 5:45 PM, Melan Nimesh <me...@wso2.com> wrote:
>
>> Hi Imesh,
>>
>> I will send a mail with details about new configuration parameters.
>>
>> Thanks,
>> Melan
>>
>>
>> On Thu, Apr 17, 2014 at 5:12 PM, Imesh Gunaratne <im...@apache.org>wrote:
>>
>>> Great work Melan!! Could you please add some notes on your correction?
>>>
>>> Thanks
>>>
>>>
>>> On Thu, Apr 17, 2014 at 7:04 AM, Isuru Perera <is...@wso2.com> wrote:
>>>
>>>> That's great Melan! Please update the thread once you commit the
>>>> changes. Then I hope Manas can also test his scenario.
>>>>
>>>> Thanks!
>>>>
>>>>
>>>> On Wed, Apr 16, 2014 at 11:37 PM, Lakmal Warusawithana <lakmal@wso2.com
>>>> > wrote:
>>>>
>>>>> great work Melan!
>>>>>
>>>>>
>>>>> On Wed, Apr 16, 2014 at 10:55 PM, Melan Nimesh <me...@apache.org>wrote:
>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I was able to fix DHCP based IP assignment issue on VCloud. I will
>>>>>> commit the fix after some testing.
>>>>>>
>>>>>> Thanks,
>>>>>> Melan
>>>>>>
>>>>>>
>>>>>> On Fri, Apr 11, 2014 at 1:52 PM, Melan Nimesh <me...@apache.org>wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I tried to assign DHCP based pool to a VM programmatically in power
>>>>>>> off mode since vCloud does not allow to change primary network in power on
>>>>>>> mode, but I am getting "The VCD entity network does not exist" [1] error,
>>>>>>> however it works find if we assign it using vCloud UI. My sample code as
>>>>>>> follows, Any idea how to fix this?
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Melan
>>>>>>>
>>>>>>> [1]
>>>>>>> Exception in thread "main"
>>>>>>> org.jclouds.vcloud.TaskInErrorStateException: error on task: {href=
>>>>>>> https://mycloud.stratogen.sg/api/task/07bbf27e-df93-4bcd-8231-72b762249bd6,
>>>>>>> owner={href=
>>>>>>> https://mycloud.stratogen.sg/api/vApp/vm-070d8809-7de1-4d13-a994-494351a75a99,
>>>>>>> name=Ubuntu 12.04.3 DHCP_1, type=application/vnd.vmware.vcloud.vm+xml},
>>>>>>> operation=Updated Virtual Machine Ubuntu 12.04.3
>>>>>>> DHCP_1(070d8809-7de1-4d13-a994-494351a75a99), startTime=Fri Apr 11 12:43:24
>>>>>>> IST 2014, endTime=Fri Apr 11 12:43:35 IST 2014, expiryTime=Thu Jul 10
>>>>>>> 12:43:24 IST 2014, error=[majorErrorCode=400, message=The VCD entity
>>>>>>> network "net1" does not exist., minorErrorCode=BAD_REQUEST,
>>>>>>> stackTrace=null, vendorSpecificErrorCode=null]} error: [majorErrorCode=400,
>>>>>>> message=The VCD entity network "net1" does not exist.,
>>>>>>> minorErrorCode=BAD_REQUEST, stackTrace=null, vendorSpecificErrorCode=null]
>>>>>>>     at
>>>>>>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:61)
>>>>>>>     at
>>>>>>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:1)
>>>>>>>     at
>>>>>>> org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:111)
>>>>>>>     at
>>>>>>> org.apache.stratos.cloud.controller.iaases.Main.waitForTask(Main.java:177)
>>>>>>>     at
>>>>>>> org.apache.stratos.cloud.controller.iaases.Main.main(Main.java:126)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> [2]
>>>>>>> package org.apache.stratos.cloud.controller.iaases;
>>>>>>> import java.net.URI;import org.apache.stratos.cloud.controller.pojo.IaasProvider;import org.jclouds.compute.ComputeService;import org.jclouds.compute.ComputeServiceContext;import org.jclouds.compute.domain.Template;import org.jclouds.ovf.Network;import org.jclouds.rest.internal.ApiContextImpl;import org.jclouds.vcloud.TaskStillRunningException;import org.jclouds.vcloud.VCloudApi;import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;import org.jclouds.vcloud.compute.strategy.InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn;import org.jclouds.vcloud.domain.NetworkConnection;import org.jclouds.vcloud.domain.NetworkConnectionSection;import org.jclouds.vcloud.domain.NetworkConnectionSection.Builder;import org.jclouds.vcloud.domain.Task;import org.jclouds.vcloud.domain.VApp;import org.jclouds.vcloud.domain.VAppTemplate;import org.jclouds.vcloud.domain.Vm;import org.jclouds.vcloud.domain.network.IpAddressAllocationMode;import org.jclouds.vcloud.domain.network.NetworkConfig;import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
>>>>>>> import static com.google.common.collect.Iterables.find;
>>>>>>> import com.google.common.base.Predicate;import com.google.common.collect.ImmutableSet;
>>>>>>> import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.addNetworkConfig;import static com.google.common.collect.Iterables.get;
>>>>>>> public class IPAssignment {
>>>>>>>
>>>>>>> 	public static void main(String[] args) throws Exception {
>>>>>>> 		IaasProvider iaasProvider = new IaasProvider();
>>>>>>> 		VCloudIaas iaas = new VCloudIaas(iaasProvider);
>>>>>>>
>>>>>>> 		iaasProvider.setType("vcloud");
>>>>>>> 		iaasProvider.setProvider("vcloud");
>>>>>>> 		iaasProvider.setIdentity("***********************");
>>>>>>> 		iaasProvider.setCredential("*********************");
>>>>>>> 		iaasProvider.setImage("https://mycloud.stratogen.sg/api/vAppTemplate/vappTemplate-a2503016-2106-4931-9100-f8759564ee82");
>>>>>>> 		iaasProvider.setProperty("jclouds.endpoint", "https://mycloud.stratogen.sg/api");
>>>>>>> 		iaasProvider.setProperty("jclouds.api-version", "1.5");
>>>>>>> 		iaasProvider.setProperty("jclouds.vcloud.version.schema", "1.5");
>>>>>>> 		iaasProvider.setProperty("autoAssignIp", "false");
>>>>>>>
>>>>>>> 		iaas.buildComputeServiceAndTemplate();
>>>>>>> 		iaasProvider.setIaas(iaas);
>>>>>>> 		Template template = iaasProvider.getTemplate();
>>>>>>> 		ComputeService computeService = iaasProvider.getComputeService();
>>>>>>> 		ComputeServiceContext context = computeService.getContext();
>>>>>>>
>>>>>>> 		InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn starter = context.utils()
>>>>>>> 				.injector()
>>>>>>> 				.getInstance(InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class);
>>>>>>>
>>>>>>> 		ApiContextImpl<VCloudApi> imp = context.unwrap();
>>>>>>> 		VCloudApi api = imp.getApi();
>>>>>>>
>>>>>>> 		VCloudTemplateOptions vOptions = VCloudTemplateOptions.class.cast(template.getOptions());
>>>>>>> 		URI templateId = URI.create(template.getImage().getId());
>>>>>>> 		VAppTemplate vAppTemplate = api.getVAppTemplateApi().getVAppTemplate(templateId);
>>>>>>> 		Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);
>>>>>>> 		NetworkConfig config = starter.networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);
>>>>>>>
>>>>>>> 		InstantiateVAppTemplateOptions options = addNetworkConfig(config);
>>>>>>>
>>>>>>> 		URI VDC = URI.create(template.getLocation().getId());
>>>>>>>
>>>>>>> 		String description = VCloudTemplateOptions.class.cast(template.getOptions()).getDescription();
>>>>>>> 		if (description == null) {
>>>>>>> 			description = "test";
>>>>>>> 		}
>>>>>>>
>>>>>>> 		options.description(description);
>>>>>>> 		options.deploy(false);
>>>>>>> 		options.powerOn(false);
>>>>>>>
>>>>>>> 		VApp vAppResponse = api.getVAppTemplateApi().createVAppInVDCByInstantiatingTemplate("test123", VDC, templateId,
>>>>>>> 				options);
>>>>>>>
>>>>>>> 		waitForTask(starter.successTester, vAppResponse.getTasks().get(0));
>>>>>>>
>>>>>>> 		vAppResponse = api.getVAppApi().getVApp(vAppResponse.getHref());
>>>>>>>
>>>>>>> 		Vm vm = get(vAppResponse.getChildren(), 0);
>>>>>>> 		NetworkConnectionSection net = vm.getNetworkConnectionSection();
>>>>>>>
>>>>>>> 		NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);
>>>>>>>
>>>>>>> 		IpAddressAllocationMode ipAllocationMode = vOptions.getIpAddressAllocationMode();
>>>>>>>
>>>>>>> 		if (ipAllocationMode == null)
>>>>>>> 			ipAllocationMode = toConnect.getIpAddressAllocationMode();
>>>>>>>
>>>>>>> 		if (ipAllocationMode == IpAddressAllocationMode.NONE)
>>>>>>> 			ipAllocationMode = IpAddressAllocationMode.POOL;
>>>>>>>
>>>>>>> 		if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
>>>>>>> 				&& toConnect.getNetwork().equals(networkToConnect.getName())) {
>>>>>>> 		} else {
>>>>>>> 			Builder builder = net.toBuilder();
>>>>>>> 			builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName())
>>>>>>> 					.connected(true).ipAddressAllocationMode(ipAllocationMode).build()));
>>>>>>>
>>>>>>> 			waitForTask(starter.successTester, api.getVmApi()
>>>>>>> 					.updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
>>>>>>>
>>>>>>> 		}
>>>>>>> 	}
>>>>>>>
>>>>>>> 	private static NetworkConnection findWithPoolAllocationOrFirst(NetworkConnectionSection net) {
>>>>>>> 		return find(net.getConnections(), new Predicate<NetworkConnection>() {
>>>>>>>
>>>>>>> 			@Override
>>>>>>> 			public boolean apply(NetworkConnection input) {
>>>>>>> 				return input.getIpAddressAllocationMode() == IpAddressAllocationMode.POOL;
>>>>>>> 			}
>>>>>>>
>>>>>>> 		}, get(net.getConnections(), 0));
>>>>>>> 	}
>>>>>>>
>>>>>>> 	public static void waitForTask(Predicate<URI> successTester, Task task) {
>>>>>>> 		if (!successTester.apply(task.getHref())) {
>>>>>>> 			throw new TaskStillRunningException(task);
>>>>>>> 		}
>>>>>>> 	}
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Apr 9, 2014 at 11:06 AM, Melan Nimesh <me...@apache.org>wrote:
>>>>>>>
>>>>>>>> Hi Manas,
>>>>>>>>
>>>>>>>> DHCP based IP assignment is still an untested scenario on Stratos
>>>>>>>> with vCloud. We are currently looking into it and we will update the thread
>>>>>>>> as progress.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Melan
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Apr 9, 2014 at 10:44 AM, Manas Padegaonkar -T (mpadegao -
>>>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mpadegao@cisco.com
>>>>>>>> > wrote:
>>>>>>>>
>>>>>>>>>  Hi Isuru,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I am able to move one step ahead & now VM Cartridges are getting
>>>>>>>>> Powered-ON & an IP is allocated to them after they got launch by Stratos.
>>>>>>>>>
>>>>>>>>> But I am not convinced with the work-around/configuration-changes
>>>>>>>>> after which this happens. We did only one change as mentioned below:---
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> “Defined Static-Pool of IPs in the Organization VDC
>>>>>>>>> Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are
>>>>>>>>> using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)”
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> The strange part is that on the vCloud-Director Web-Console,
>>>>>>>>> VM-Cartridge IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240
>>>>>>>>> but inside VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool
>>>>>>>>> i.e. 6.6.6.10-6.6.6.200.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Attaching screenshot of vCloud-Director.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>>
>>>>>>>>> Manas
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>>>>> *Sent:* Tuesday, April 08, 2014 3:22 PM
>>>>>>>>> *To:* Isuru Perera; dev
>>>>>>>>>
>>>>>>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director:
>>>>>>>>> Cartridge VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi Isuru,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I went through this troubleshooting guide yesterday & we have
>>>>>>>>> sufficient IPs available in the dhcp pool.
>>>>>>>>>
>>>>>>>>> I never get any error whenever I manually launch the VMs under the
>>>>>>>>> same Organization VDC.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>>
>>>>>>>>> Manas
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *From:* Isuru Perera [mailto:isurup@wso2.com <is...@wso2.com>]
>>>>>>>>> *Sent:* Tuesday, April 08, 2014 1:04 PM
>>>>>>>>> *To:* dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director:
>>>>>>>>> Cartridge VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi Manas,
>>>>>>>>>
>>>>>>>>> I analyzed the logs.
>>>>>>>>>
>>>>>>>>> Could you please check why following error appears?
>>>>>>>>>
>>>>>>>>> "There are insufficient IP addresses to complete operation. You
>>>>>>>>> need to add IP addresses to the network that is associated with the object
>>>>>>>>> being created or deployed"
>>>>>>>>>
>>>>>>>>> Please check following.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
>>>>>>>>>
>>>>>>>>> Possible solution according to docs:
>>>>>>>>>
>>>>>>>>> * Assign additional IP addresses to the network where the
>>>>>>>>> application is being deployed.
>>>>>>>>>
>>>>>>>>> * Delete unwanted deployments from vFabric Application Director
>>>>>>>>> to free some IP addresses and storage space.
>>>>>>>>>
>>>>>>>>> Please check and let us know.
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao -
>>>>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <
>>>>>>>>> mpadegao@cisco.com> wrote:
>>>>>>>>>
>>>>>>>>> Hi Isuru & Sajith,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> More detailed logs are attached herewith. Awaiting your reply.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>>
>>>>>>>>> Manas
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>>>>> *Sent:* Monday, April 07, 2014 5:21 PM
>>>>>>>>> *To:* dev@stratos.incubator.apache.org
>>>>>>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director:
>>>>>>>>> Cartridge VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi Sajith & Isuru
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Attached are the wso2carbon logs.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> In my vCloud-Director Setup  VM should get Internal IPs from
>>>>>>>>> Org-VDC Network(6.6.6.0/24) & IP Forwarding & Natting is taken
>>>>>>>>> care at Edge-GW which is an interface to outside world(5.5.5.0/24i/e/ floating IP NW)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>>
>>>>>>>>> Manas
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com<sa...@wso2.com>]
>>>>>>>>>
>>>>>>>>> *Sent:* Monday, April 07, 2014 3:17 PM
>>>>>>>>> *To:* dev@stratos.incubator.apache.org
>>>>>>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director:
>>>>>>>>> Cartridge VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi Manas,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Did you check the stratos log file? If you can please share the
>>>>>>>>> log file found in <Stratos>/repository/logs/wso2carbon.log
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> Sajith
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao -
>>>>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <
>>>>>>>>> mpadegao@cisco.com> wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I am using Stratos over vCloud0-Director.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I am able to subscribe to the cartridge from stratos-cli & the VM
>>>>>>>>> is getting created on the vCloud-Director but it remains in Powered-Off
>>>>>>>>> state. Thereafter multiple-vms are getting spawned. When I manually
>>>>>>>>> power-on the Cartridge-VM, it fails to get network configuration & comes up
>>>>>>>>> without IP Address.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Please suggest.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>>
>>>>>>>>> Manas
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>> *Sajith Kariyawasam*
>>>>>>>>>
>>>>>>>>> *Senior Software Engineer; WSO2, Inc.*
>>>>>>>>>
>>>>>>>>> *AMIE (SL)*
>>>>>>>>>
>>>>>>>>> *Blog: http://sajithblogs.blogspot.com/
>>>>>>>>> <http://sajithblogs.blogspot.com/>*
>>>>>>>>>
>>>>>>>>> *Mobile: +94772269575 <%2B94772269575>*
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>> Isuru Perera
>>>>>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>>>>>>>> Lean . Enterprise . Middleware
>>>>>>>>>
>>>>>>>>> about.me/chrishantha
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Melan Nimesh Jayasinghage
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Melan Nimesh Jayasinghage
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Melan Nimesh Jayasinghage
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Lakmal Warusawithana
>>>>> Software Architect; WSO2 Inc.
>>>>> Mobile : +94714289692
>>>>> Blog : http://lakmalsview.blogspot.com/
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Isuru Perera
>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>>> Lean . Enterprise . Middleware
>>>>
>>>> about.me/chrishantha
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PPMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> *Melan Nimesh*
>> Software Engineer;
>> WSO2 Inc.;  http://wso2.org
>> E-mail: melan AT wso2.com;
>> Mobile: +94 77 631 6759
>>
>>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PPMC Member, Apache Stratos
>



-- 
Melan Nimesh Jayasinghage

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Imesh Gunaratne <im...@apache.org>.
Thanks Melan!


On Thu, Apr 17, 2014 at 5:45 PM, Melan Nimesh <me...@wso2.com> wrote:

> Hi Imesh,
>
> I will send a mail with details about new configuration parameters.
>
> Thanks,
> Melan
>
>
> On Thu, Apr 17, 2014 at 5:12 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Great work Melan!! Could you please add some notes on your correction?
>>
>> Thanks
>>
>>
>> On Thu, Apr 17, 2014 at 7:04 AM, Isuru Perera <is...@wso2.com> wrote:
>>
>>> That's great Melan! Please update the thread once you commit the
>>> changes. Then I hope Manas can also test his scenario.
>>>
>>> Thanks!
>>>
>>>
>>> On Wed, Apr 16, 2014 at 11:37 PM, Lakmal Warusawithana <la...@wso2.com>wrote:
>>>
>>>> great work Melan!
>>>>
>>>>
>>>> On Wed, Apr 16, 2014 at 10:55 PM, Melan Nimesh <me...@apache.org>wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> I was able to fix DHCP based IP assignment issue on VCloud. I will
>>>>> commit the fix after some testing.
>>>>>
>>>>> Thanks,
>>>>> Melan
>>>>>
>>>>>
>>>>> On Fri, Apr 11, 2014 at 1:52 PM, Melan Nimesh <me...@apache.org>wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I tried to assign DHCP based pool to a VM programmatically in power
>>>>>> off mode since vCloud does not allow to change primary network in power on
>>>>>> mode, but I am getting "The VCD entity network does not exist" [1] error,
>>>>>> however it works find if we assign it using vCloud UI. My sample code as
>>>>>> follows, Any idea how to fix this?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Melan
>>>>>>
>>>>>> [1]
>>>>>> Exception in thread "main"
>>>>>> org.jclouds.vcloud.TaskInErrorStateException: error on task: {href=
>>>>>> https://mycloud.stratogen.sg/api/task/07bbf27e-df93-4bcd-8231-72b762249bd6,
>>>>>> owner={href=
>>>>>> https://mycloud.stratogen.sg/api/vApp/vm-070d8809-7de1-4d13-a994-494351a75a99,
>>>>>> name=Ubuntu 12.04.3 DHCP_1, type=application/vnd.vmware.vcloud.vm+xml},
>>>>>> operation=Updated Virtual Machine Ubuntu 12.04.3
>>>>>> DHCP_1(070d8809-7de1-4d13-a994-494351a75a99), startTime=Fri Apr 11 12:43:24
>>>>>> IST 2014, endTime=Fri Apr 11 12:43:35 IST 2014, expiryTime=Thu Jul 10
>>>>>> 12:43:24 IST 2014, error=[majorErrorCode=400, message=The VCD entity
>>>>>> network "net1" does not exist., minorErrorCode=BAD_REQUEST,
>>>>>> stackTrace=null, vendorSpecificErrorCode=null]} error: [majorErrorCode=400,
>>>>>> message=The VCD entity network "net1" does not exist.,
>>>>>> minorErrorCode=BAD_REQUEST, stackTrace=null, vendorSpecificErrorCode=null]
>>>>>>     at
>>>>>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:61)
>>>>>>     at
>>>>>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:1)
>>>>>>     at
>>>>>> org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:111)
>>>>>>     at
>>>>>> org.apache.stratos.cloud.controller.iaases.Main.waitForTask(Main.java:177)
>>>>>>     at
>>>>>> org.apache.stratos.cloud.controller.iaases.Main.main(Main.java:126)
>>>>>>
>>>>>>
>>>>>>
>>>>>> [2]
>>>>>> package org.apache.stratos.cloud.controller.iaases;
>>>>>> import java.net.URI;import org.apache.stratos.cloud.controller.pojo.IaasProvider;import org.jclouds.compute.ComputeService;import org.jclouds.compute.ComputeServiceContext;import org.jclouds.compute.domain.Template;import org.jclouds.ovf.Network;import org.jclouds.rest.internal.ApiContextImpl;import org.jclouds.vcloud.TaskStillRunningException;import org.jclouds.vcloud.VCloudApi;import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;import org.jclouds.vcloud.compute.strategy.InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn;import org.jclouds.vcloud.domain.NetworkConnection;import org.jclouds.vcloud.domain.NetworkConnectionSection;import org.jclouds.vcloud.domain.NetworkConnectionSection.Builder;import org.jclouds.vcloud.domain.Task;import org.jclouds.vcloud.domain.VApp;import org.jclouds.vcloud.domain.VAppTemplate;import org.jclouds.vcloud.domain.Vm;import org.jclouds.vcloud.domain.network.IpAddressAllocationMode;import org.jclouds.vcloud.domain.network.NetworkConfig;import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
>>>>>> import static com.google.common.collect.Iterables.find;
>>>>>> import com.google.common.base.Predicate;import com.google.common.collect.ImmutableSet;
>>>>>> import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.addNetworkConfig;import static com.google.common.collect.Iterables.get;
>>>>>> public class IPAssignment {
>>>>>>
>>>>>> 	public static void main(String[] args) throws Exception {
>>>>>> 		IaasProvider iaasProvider = new IaasProvider();
>>>>>> 		VCloudIaas iaas = new VCloudIaas(iaasProvider);
>>>>>>
>>>>>> 		iaasProvider.setType("vcloud");
>>>>>> 		iaasProvider.setProvider("vcloud");
>>>>>> 		iaasProvider.setIdentity("***********************");
>>>>>> 		iaasProvider.setCredential("*********************");
>>>>>> 		iaasProvider.setImage("https://mycloud.stratogen.sg/api/vAppTemplate/vappTemplate-a2503016-2106-4931-9100-f8759564ee82");
>>>>>> 		iaasProvider.setProperty("jclouds.endpoint", "https://mycloud.stratogen.sg/api");
>>>>>> 		iaasProvider.setProperty("jclouds.api-version", "1.5");
>>>>>> 		iaasProvider.setProperty("jclouds.vcloud.version.schema", "1.5");
>>>>>> 		iaasProvider.setProperty("autoAssignIp", "false");
>>>>>>
>>>>>> 		iaas.buildComputeServiceAndTemplate();
>>>>>> 		iaasProvider.setIaas(iaas);
>>>>>> 		Template template = iaasProvider.getTemplate();
>>>>>> 		ComputeService computeService = iaasProvider.getComputeService();
>>>>>> 		ComputeServiceContext context = computeService.getContext();
>>>>>>
>>>>>> 		InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn starter = context.utils()
>>>>>> 				.injector()
>>>>>> 				.getInstance(InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class);
>>>>>>
>>>>>> 		ApiContextImpl<VCloudApi> imp = context.unwrap();
>>>>>> 		VCloudApi api = imp.getApi();
>>>>>>
>>>>>> 		VCloudTemplateOptions vOptions = VCloudTemplateOptions.class.cast(template.getOptions());
>>>>>> 		URI templateId = URI.create(template.getImage().getId());
>>>>>> 		VAppTemplate vAppTemplate = api.getVAppTemplateApi().getVAppTemplate(templateId);
>>>>>> 		Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);
>>>>>> 		NetworkConfig config = starter.networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);
>>>>>>
>>>>>> 		InstantiateVAppTemplateOptions options = addNetworkConfig(config);
>>>>>>
>>>>>> 		URI VDC = URI.create(template.getLocation().getId());
>>>>>>
>>>>>> 		String description = VCloudTemplateOptions.class.cast(template.getOptions()).getDescription();
>>>>>> 		if (description == null) {
>>>>>> 			description = "test";
>>>>>> 		}
>>>>>>
>>>>>> 		options.description(description);
>>>>>> 		options.deploy(false);
>>>>>> 		options.powerOn(false);
>>>>>>
>>>>>> 		VApp vAppResponse = api.getVAppTemplateApi().createVAppInVDCByInstantiatingTemplate("test123", VDC, templateId,
>>>>>> 				options);
>>>>>>
>>>>>> 		waitForTask(starter.successTester, vAppResponse.getTasks().get(0));
>>>>>>
>>>>>> 		vAppResponse = api.getVAppApi().getVApp(vAppResponse.getHref());
>>>>>>
>>>>>> 		Vm vm = get(vAppResponse.getChildren(), 0);
>>>>>> 		NetworkConnectionSection net = vm.getNetworkConnectionSection();
>>>>>>
>>>>>> 		NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);
>>>>>>
>>>>>> 		IpAddressAllocationMode ipAllocationMode = vOptions.getIpAddressAllocationMode();
>>>>>>
>>>>>> 		if (ipAllocationMode == null)
>>>>>> 			ipAllocationMode = toConnect.getIpAddressAllocationMode();
>>>>>>
>>>>>> 		if (ipAllocationMode == IpAddressAllocationMode.NONE)
>>>>>> 			ipAllocationMode = IpAddressAllocationMode.POOL;
>>>>>>
>>>>>> 		if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
>>>>>> 				&& toConnect.getNetwork().equals(networkToConnect.getName())) {
>>>>>> 		} else {
>>>>>> 			Builder builder = net.toBuilder();
>>>>>> 			builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName())
>>>>>> 					.connected(true).ipAddressAllocationMode(ipAllocationMode).build()));
>>>>>>
>>>>>> 			waitForTask(starter.successTester, api.getVmApi()
>>>>>> 					.updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
>>>>>>
>>>>>> 		}
>>>>>> 	}
>>>>>>
>>>>>> 	private static NetworkConnection findWithPoolAllocationOrFirst(NetworkConnectionSection net) {
>>>>>> 		return find(net.getConnections(), new Predicate<NetworkConnection>() {
>>>>>>
>>>>>> 			@Override
>>>>>> 			public boolean apply(NetworkConnection input) {
>>>>>> 				return input.getIpAddressAllocationMode() == IpAddressAllocationMode.POOL;
>>>>>> 			}
>>>>>>
>>>>>> 		}, get(net.getConnections(), 0));
>>>>>> 	}
>>>>>>
>>>>>> 	public static void waitForTask(Predicate<URI> successTester, Task task) {
>>>>>> 		if (!successTester.apply(task.getHref())) {
>>>>>> 			throw new TaskStillRunningException(task);
>>>>>> 		}
>>>>>> 	}
>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Apr 9, 2014 at 11:06 AM, Melan Nimesh <me...@apache.org>wrote:
>>>>>>
>>>>>>> Hi Manas,
>>>>>>>
>>>>>>> DHCP based IP assignment is still an untested scenario on Stratos
>>>>>>> with vCloud. We are currently looking into it and we will update the thread
>>>>>>> as progress.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Melan
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Apr 9, 2014 at 10:44 AM, Manas Padegaonkar -T (mpadegao -
>>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>wrote:
>>>>>>>
>>>>>>>>  Hi Isuru,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I am able to move one step ahead & now VM Cartridges are getting
>>>>>>>> Powered-ON & an IP is allocated to them after they got launch by Stratos.
>>>>>>>>
>>>>>>>> But I am not convinced with the work-around/configuration-changes
>>>>>>>> after which this happens. We did only one change as mentioned below:---
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> “Defined Static-Pool of IPs in the Organization VDC
>>>>>>>> Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are
>>>>>>>> using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)”
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> The strange part is that on the vCloud-Director Web-Console,
>>>>>>>> VM-Cartridge IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240
>>>>>>>> but inside VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool
>>>>>>>> i.e. 6.6.6.10-6.6.6.200.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Attaching screenshot of vCloud-Director.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> Manas
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>>>> *Sent:* Tuesday, April 08, 2014 3:22 PM
>>>>>>>> *To:* Isuru Perera; dev
>>>>>>>>
>>>>>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director:
>>>>>>>> Cartridge VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Hi Isuru,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I went through this troubleshooting guide yesterday & we have
>>>>>>>> sufficient IPs available in the dhcp pool.
>>>>>>>>
>>>>>>>> I never get any error whenever I manually launch the VMs under the
>>>>>>>> same Organization VDC.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> Manas
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *From:* Isuru Perera [mailto:isurup@wso2.com <is...@wso2.com>]
>>>>>>>> *Sent:* Tuesday, April 08, 2014 1:04 PM
>>>>>>>> *To:* dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director:
>>>>>>>> Cartridge VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Hi Manas,
>>>>>>>>
>>>>>>>> I analyzed the logs.
>>>>>>>>
>>>>>>>> Could you please check why following error appears?
>>>>>>>>
>>>>>>>> "There are insufficient IP addresses to complete operation. You
>>>>>>>> need to add IP addresses to the network that is associated with the object
>>>>>>>> being created or deployed"
>>>>>>>>
>>>>>>>> Please check following.
>>>>>>>>
>>>>>>>>
>>>>>>>> http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
>>>>>>>>
>>>>>>>> Possible solution according to docs:
>>>>>>>>
>>>>>>>> * Assign additional IP addresses to the network where the
>>>>>>>> application is being deployed.
>>>>>>>>
>>>>>>>> * Delete unwanted deployments from vFabric Application Director to
>>>>>>>> free some IP addresses and storage space.
>>>>>>>>
>>>>>>>> Please check and let us know.
>>>>>>>>
>>>>>>>> Thanks!
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao -
>>>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hi Isuru & Sajith,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> More detailed logs are attached herewith. Awaiting your reply.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> Manas
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>>>> *Sent:* Monday, April 07, 2014 5:21 PM
>>>>>>>> *To:* dev@stratos.incubator.apache.org
>>>>>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director:
>>>>>>>> Cartridge VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Hi Sajith & Isuru
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Attached are the wso2carbon logs.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> In my vCloud-Director Setup  VM should get Internal IPs from
>>>>>>>> Org-VDC Network(6.6.6.0/24) & IP Forwarding & Natting is taken
>>>>>>>> care at Edge-GW which is an interface to outside world(5.5.5.0/24i/e/ floating IP NW)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> Manas
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com<sa...@wso2.com>]
>>>>>>>>
>>>>>>>> *Sent:* Monday, April 07, 2014 3:17 PM
>>>>>>>> *To:* dev@stratos.incubator.apache.org
>>>>>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director:
>>>>>>>> Cartridge VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Hi Manas,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Did you check the stratos log file? If you can please share the log
>>>>>>>> file found in <Stratos>/repository/logs/wso2carbon.log
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> Sajith
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao -
>>>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I am using Stratos over vCloud0-Director.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I am able to subscribe to the cartridge from stratos-cli & the VM
>>>>>>>> is getting created on the vCloud-Director but it remains in Powered-Off
>>>>>>>> state. Thereafter multiple-vms are getting spawned. When I manually
>>>>>>>> power-on the Cartridge-VM, it fails to get network configuration & comes up
>>>>>>>> without IP Address.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Please suggest.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> Manas
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> *Sajith Kariyawasam*
>>>>>>>>
>>>>>>>> *Senior Software Engineer; WSO2, Inc.*
>>>>>>>>
>>>>>>>> *AMIE (SL)*
>>>>>>>>
>>>>>>>> *Blog: http://sajithblogs.blogspot.com/
>>>>>>>> <http://sajithblogs.blogspot.com/>*
>>>>>>>>
>>>>>>>> *Mobile: +94772269575 <%2B94772269575>*
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> Isuru Perera
>>>>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>>>>>>> Lean . Enterprise . Middleware
>>>>>>>>
>>>>>>>> about.me/chrishantha
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Melan Nimesh Jayasinghage
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Melan Nimesh Jayasinghage
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Melan Nimesh Jayasinghage
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Lakmal Warusawithana
>>>> Software Architect; WSO2 Inc.
>>>> Mobile : +94714289692
>>>> Blog : http://lakmalsview.blogspot.com/
>>>>
>>>>
>>>
>>>
>>> --
>>> Isuru Perera
>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>> Lean . Enterprise . Middleware
>>>
>>> about.me/chrishantha
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PPMC Member, Apache Stratos
>>
>
>
>
> --
> *Melan Nimesh*
> Software Engineer;
> WSO2 Inc.;  http://wso2.org
> E-mail: melan AT wso2.com;
> Mobile: +94 77 631 6759
>
>


-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PPMC Member, Apache Stratos

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Melan Nimesh <me...@wso2.com>.
Hi Imesh,

I will send a mail with details about new configuration parameters.

Thanks,
Melan


On Thu, Apr 17, 2014 at 5:12 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Great work Melan!! Could you please add some notes on your correction?
>
> Thanks
>
>
> On Thu, Apr 17, 2014 at 7:04 AM, Isuru Perera <is...@wso2.com> wrote:
>
>> That's great Melan! Please update the thread once you commit the changes.
>> Then I hope Manas can also test his scenario.
>>
>> Thanks!
>>
>>
>> On Wed, Apr 16, 2014 at 11:37 PM, Lakmal Warusawithana <la...@wso2.com>wrote:
>>
>>> great work Melan!
>>>
>>>
>>> On Wed, Apr 16, 2014 at 10:55 PM, Melan Nimesh <me...@apache.org> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I was able to fix DHCP based IP assignment issue on VCloud. I will
>>>> commit the fix after some testing.
>>>>
>>>> Thanks,
>>>> Melan
>>>>
>>>>
>>>> On Fri, Apr 11, 2014 at 1:52 PM, Melan Nimesh <me...@apache.org> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I tried to assign DHCP based pool to a VM programmatically in power
>>>>> off mode since vCloud does not allow to change primary network in power on
>>>>> mode, but I am getting "The VCD entity network does not exist" [1] error,
>>>>> however it works find if we assign it using vCloud UI. My sample code as
>>>>> follows, Any idea how to fix this?
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Melan
>>>>>
>>>>> [1]
>>>>> Exception in thread "main"
>>>>> org.jclouds.vcloud.TaskInErrorStateException: error on task: {href=
>>>>> https://mycloud.stratogen.sg/api/task/07bbf27e-df93-4bcd-8231-72b762249bd6,
>>>>> owner={href=
>>>>> https://mycloud.stratogen.sg/api/vApp/vm-070d8809-7de1-4d13-a994-494351a75a99,
>>>>> name=Ubuntu 12.04.3 DHCP_1, type=application/vnd.vmware.vcloud.vm+xml},
>>>>> operation=Updated Virtual Machine Ubuntu 12.04.3
>>>>> DHCP_1(070d8809-7de1-4d13-a994-494351a75a99), startTime=Fri Apr 11 12:43:24
>>>>> IST 2014, endTime=Fri Apr 11 12:43:35 IST 2014, expiryTime=Thu Jul 10
>>>>> 12:43:24 IST 2014, error=[majorErrorCode=400, message=The VCD entity
>>>>> network "net1" does not exist., minorErrorCode=BAD_REQUEST,
>>>>> stackTrace=null, vendorSpecificErrorCode=null]} error: [majorErrorCode=400,
>>>>> message=The VCD entity network "net1" does not exist.,
>>>>> minorErrorCode=BAD_REQUEST, stackTrace=null, vendorSpecificErrorCode=null]
>>>>>     at
>>>>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:61)
>>>>>     at
>>>>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:1)
>>>>>     at
>>>>> org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:111)
>>>>>     at
>>>>> org.apache.stratos.cloud.controller.iaases.Main.waitForTask(Main.java:177)
>>>>>     at
>>>>> org.apache.stratos.cloud.controller.iaases.Main.main(Main.java:126)
>>>>>
>>>>>
>>>>>
>>>>> [2]
>>>>> package org.apache.stratos.cloud.controller.iaases;
>>>>> import java.net.URI;import org.apache.stratos.cloud.controller.pojo.IaasProvider;import org.jclouds.compute.ComputeService;import org.jclouds.compute.ComputeServiceContext;import org.jclouds.compute.domain.Template;import org.jclouds.ovf.Network;import org.jclouds.rest.internal.ApiContextImpl;import org.jclouds.vcloud.TaskStillRunningException;import org.jclouds.vcloud.VCloudApi;import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;import org.jclouds.vcloud.compute.strategy.InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn;import org.jclouds.vcloud.domain.NetworkConnection;import org.jclouds.vcloud.domain.NetworkConnectionSection;import org.jclouds.vcloud.domain.NetworkConnectionSection.Builder;import org.jclouds.vcloud.domain.Task;import org.jclouds.vcloud.domain.VApp;import org.jclouds.vcloud.domain.VAppTemplate;import org.jclouds.vcloud.domain.Vm;import org.jclouds.vcloud.domain.network.IpAddressAllocationMode;import org.jclouds.vcloud.domain.network.NetworkConfig;import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
>>>>> import static com.google.common.collect.Iterables.find;
>>>>> import com.google.common.base.Predicate;import com.google.common.collect.ImmutableSet;
>>>>> import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.addNetworkConfig;import static com.google.common.collect.Iterables.get;
>>>>> public class IPAssignment {
>>>>>
>>>>> 	public static void main(String[] args) throws Exception {
>>>>> 		IaasProvider iaasProvider = new IaasProvider();
>>>>> 		VCloudIaas iaas = new VCloudIaas(iaasProvider);
>>>>>
>>>>> 		iaasProvider.setType("vcloud");
>>>>> 		iaasProvider.setProvider("vcloud");
>>>>> 		iaasProvider.setIdentity("***********************");
>>>>> 		iaasProvider.setCredential("*********************");
>>>>> 		iaasProvider.setImage("https://mycloud.stratogen.sg/api/vAppTemplate/vappTemplate-a2503016-2106-4931-9100-f8759564ee82");
>>>>> 		iaasProvider.setProperty("jclouds.endpoint", "https://mycloud.stratogen.sg/api");
>>>>> 		iaasProvider.setProperty("jclouds.api-version", "1.5");
>>>>> 		iaasProvider.setProperty("jclouds.vcloud.version.schema", "1.5");
>>>>> 		iaasProvider.setProperty("autoAssignIp", "false");
>>>>>
>>>>> 		iaas.buildComputeServiceAndTemplate();
>>>>> 		iaasProvider.setIaas(iaas);
>>>>> 		Template template = iaasProvider.getTemplate();
>>>>> 		ComputeService computeService = iaasProvider.getComputeService();
>>>>> 		ComputeServiceContext context = computeService.getContext();
>>>>>
>>>>> 		InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn starter = context.utils()
>>>>> 				.injector()
>>>>> 				.getInstance(InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class);
>>>>>
>>>>> 		ApiContextImpl<VCloudApi> imp = context.unwrap();
>>>>> 		VCloudApi api = imp.getApi();
>>>>>
>>>>> 		VCloudTemplateOptions vOptions = VCloudTemplateOptions.class.cast(template.getOptions());
>>>>> 		URI templateId = URI.create(template.getImage().getId());
>>>>> 		VAppTemplate vAppTemplate = api.getVAppTemplateApi().getVAppTemplate(templateId);
>>>>> 		Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);
>>>>> 		NetworkConfig config = starter.networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);
>>>>>
>>>>> 		InstantiateVAppTemplateOptions options = addNetworkConfig(config);
>>>>>
>>>>> 		URI VDC = URI.create(template.getLocation().getId());
>>>>>
>>>>> 		String description = VCloudTemplateOptions.class.cast(template.getOptions()).getDescription();
>>>>> 		if (description == null) {
>>>>> 			description = "test";
>>>>> 		}
>>>>>
>>>>> 		options.description(description);
>>>>> 		options.deploy(false);
>>>>> 		options.powerOn(false);
>>>>>
>>>>> 		VApp vAppResponse = api.getVAppTemplateApi().createVAppInVDCByInstantiatingTemplate("test123", VDC, templateId,
>>>>> 				options);
>>>>>
>>>>> 		waitForTask(starter.successTester, vAppResponse.getTasks().get(0));
>>>>>
>>>>> 		vAppResponse = api.getVAppApi().getVApp(vAppResponse.getHref());
>>>>>
>>>>> 		Vm vm = get(vAppResponse.getChildren(), 0);
>>>>> 		NetworkConnectionSection net = vm.getNetworkConnectionSection();
>>>>>
>>>>> 		NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);
>>>>>
>>>>> 		IpAddressAllocationMode ipAllocationMode = vOptions.getIpAddressAllocationMode();
>>>>>
>>>>> 		if (ipAllocationMode == null)
>>>>> 			ipAllocationMode = toConnect.getIpAddressAllocationMode();
>>>>>
>>>>> 		if (ipAllocationMode == IpAddressAllocationMode.NONE)
>>>>> 			ipAllocationMode = IpAddressAllocationMode.POOL;
>>>>>
>>>>> 		if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
>>>>> 				&& toConnect.getNetwork().equals(networkToConnect.getName())) {
>>>>> 		} else {
>>>>> 			Builder builder = net.toBuilder();
>>>>> 			builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName())
>>>>> 					.connected(true).ipAddressAllocationMode(ipAllocationMode).build()));
>>>>>
>>>>> 			waitForTask(starter.successTester, api.getVmApi()
>>>>> 					.updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
>>>>>
>>>>> 		}
>>>>> 	}
>>>>>
>>>>> 	private static NetworkConnection findWithPoolAllocationOrFirst(NetworkConnectionSection net) {
>>>>> 		return find(net.getConnections(), new Predicate<NetworkConnection>() {
>>>>>
>>>>> 			@Override
>>>>> 			public boolean apply(NetworkConnection input) {
>>>>> 				return input.getIpAddressAllocationMode() == IpAddressAllocationMode.POOL;
>>>>> 			}
>>>>>
>>>>> 		}, get(net.getConnections(), 0));
>>>>> 	}
>>>>>
>>>>> 	public static void waitForTask(Predicate<URI> successTester, Task task) {
>>>>> 		if (!successTester.apply(task.getHref())) {
>>>>> 			throw new TaskStillRunningException(task);
>>>>> 		}
>>>>> 	}
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Apr 9, 2014 at 11:06 AM, Melan Nimesh <me...@apache.org>wrote:
>>>>>
>>>>>> Hi Manas,
>>>>>>
>>>>>> DHCP based IP assignment is still an untested scenario on Stratos
>>>>>> with vCloud. We are currently looking into it and we will update the thread
>>>>>> as progress.
>>>>>>
>>>>>> Thanks,
>>>>>> Melan
>>>>>>
>>>>>>
>>>>>> On Wed, Apr 9, 2014 at 10:44 AM, Manas Padegaonkar -T (mpadegao -
>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>wrote:
>>>>>>
>>>>>>>  Hi Isuru,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I am able to move one step ahead & now VM Cartridges are getting
>>>>>>> Powered-ON & an IP is allocated to them after they got launch by Stratos.
>>>>>>>
>>>>>>> But I am not convinced with the work-around/configuration-changes
>>>>>>> after which this happens. We did only one change as mentioned below:---
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> “Defined Static-Pool of IPs in the Organization VDC
>>>>>>> Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are
>>>>>>> using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)”
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> The strange part is that on the vCloud-Director Web-Console,
>>>>>>> VM-Cartridge IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240
>>>>>>> but inside VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool
>>>>>>> i.e. 6.6.6.10-6.6.6.200.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Attaching screenshot of vCloud-Director.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Manas
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>>> *Sent:* Tuesday, April 08, 2014 3:22 PM
>>>>>>> *To:* Isuru Perera; dev
>>>>>>>
>>>>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hi Isuru,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I went through this troubleshooting guide yesterday & we have
>>>>>>> sufficient IPs available in the dhcp pool.
>>>>>>>
>>>>>>> I never get any error whenever I manually launch the VMs under the
>>>>>>> same Organization VDC.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Manas
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *From:* Isuru Perera [mailto:isurup@wso2.com <is...@wso2.com>]
>>>>>>> *Sent:* Tuesday, April 08, 2014 1:04 PM
>>>>>>> *To:* dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hi Manas,
>>>>>>>
>>>>>>> I analyzed the logs.
>>>>>>>
>>>>>>> Could you please check why following error appears?
>>>>>>>
>>>>>>> "There are insufficient IP addresses to complete operation. You need
>>>>>>> to add IP addresses to the network that is associated with the object being
>>>>>>> created or deployed"
>>>>>>>
>>>>>>> Please check following.
>>>>>>>
>>>>>>>
>>>>>>> http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
>>>>>>>
>>>>>>> Possible solution according to docs:
>>>>>>>
>>>>>>> * Assign additional IP addresses to the network where the
>>>>>>> application is being deployed.
>>>>>>>
>>>>>>> * Delete unwanted deployments from vFabric Application Director to
>>>>>>> free some IP addresses and storage space.
>>>>>>>
>>>>>>> Please check and let us know.
>>>>>>>
>>>>>>> Thanks!
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao -
>>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Hi Isuru & Sajith,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> More detailed logs are attached herewith. Awaiting your reply.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Manas
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>>> *Sent:* Monday, April 07, 2014 5:21 PM
>>>>>>> *To:* dev@stratos.incubator.apache.org
>>>>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hi Sajith & Isuru
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Attached are the wso2carbon logs.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC
>>>>>>> Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at
>>>>>>> Edge-GW which is an interface to outside world(5.5.5.0/24 i/e/
>>>>>>> floating IP NW)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Manas
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com <sa...@wso2.com>]
>>>>>>>
>>>>>>> *Sent:* Monday, April 07, 2014 3:17 PM
>>>>>>> *To:* dev@stratos.incubator.apache.org
>>>>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hi Manas,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Did you check the stratos log file? If you can please share the log
>>>>>>> file found in <Stratos>/repository/logs/wso2carbon.log
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Sajith
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao -
>>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I am using Stratos over vCloud0-Director.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I am able to subscribe to the cartridge from stratos-cli & the VM is
>>>>>>> getting created on the vCloud-Director but it remains in Powered-Off state.
>>>>>>> Thereafter multiple-vms are getting spawned. When I manually power-on the
>>>>>>> Cartridge-VM, it fails to get network configuration & comes up without IP
>>>>>>> Address.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Please suggest.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Manas
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> *Sajith Kariyawasam*
>>>>>>>
>>>>>>> *Senior Software Engineer; WSO2, Inc.*
>>>>>>>
>>>>>>> *AMIE (SL)*
>>>>>>>
>>>>>>> *Blog: http://sajithblogs.blogspot.com/
>>>>>>> <http://sajithblogs.blogspot.com/>*
>>>>>>>
>>>>>>> *Mobile: +94772269575 <%2B94772269575>*
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> Isuru Perera
>>>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>>>>>> Lean . Enterprise . Middleware
>>>>>>>
>>>>>>> about.me/chrishantha
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Melan Nimesh Jayasinghage
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Melan Nimesh Jayasinghage
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Melan Nimesh Jayasinghage
>>>>
>>>
>>>
>>>
>>> --
>>> Lakmal Warusawithana
>>> Software Architect; WSO2 Inc.
>>> Mobile : +94714289692
>>> Blog : http://lakmalsview.blogspot.com/
>>>
>>>
>>
>>
>> --
>> Isuru Perera
>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>> Lean . Enterprise . Middleware
>>
>> about.me/chrishantha
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PPMC Member, Apache Stratos
>



-- 
*Melan Nimesh*
Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: melan AT wso2.com;
Mobile: +94 77 631 6759

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Imesh Gunaratne <im...@apache.org>.
Great work Melan!! Could you please add some notes on your correction?

Thanks


On Thu, Apr 17, 2014 at 7:04 AM, Isuru Perera <is...@wso2.com> wrote:

> That's great Melan! Please update the thread once you commit the changes.
> Then I hope Manas can also test his scenario.
>
> Thanks!
>
>
> On Wed, Apr 16, 2014 at 11:37 PM, Lakmal Warusawithana <la...@wso2.com>wrote:
>
>> great work Melan!
>>
>>
>> On Wed, Apr 16, 2014 at 10:55 PM, Melan Nimesh <me...@apache.org> wrote:
>>
>>> Hi All,
>>>
>>> I was able to fix DHCP based IP assignment issue on VCloud. I will
>>> commit the fix after some testing.
>>>
>>> Thanks,
>>> Melan
>>>
>>>
>>> On Fri, Apr 11, 2014 at 1:52 PM, Melan Nimesh <me...@apache.org> wrote:
>>>
>>>> Hi,
>>>>
>>>> I tried to assign DHCP based pool to a VM programmatically in power off
>>>> mode since vCloud does not allow to change primary network in power on
>>>> mode, but I am getting "The VCD entity network does not exist" [1] error,
>>>> however it works find if we assign it using vCloud UI. My sample code as
>>>> follows, Any idea how to fix this?
>>>>
>>>>
>>>> Thanks,
>>>> Melan
>>>>
>>>> [1]
>>>> Exception in thread "main"
>>>> org.jclouds.vcloud.TaskInErrorStateException: error on task: {href=
>>>> https://mycloud.stratogen.sg/api/task/07bbf27e-df93-4bcd-8231-72b762249bd6,
>>>> owner={href=
>>>> https://mycloud.stratogen.sg/api/vApp/vm-070d8809-7de1-4d13-a994-494351a75a99,
>>>> name=Ubuntu 12.04.3 DHCP_1, type=application/vnd.vmware.vcloud.vm+xml},
>>>> operation=Updated Virtual Machine Ubuntu 12.04.3
>>>> DHCP_1(070d8809-7de1-4d13-a994-494351a75a99), startTime=Fri Apr 11 12:43:24
>>>> IST 2014, endTime=Fri Apr 11 12:43:35 IST 2014, expiryTime=Thu Jul 10
>>>> 12:43:24 IST 2014, error=[majorErrorCode=400, message=The VCD entity
>>>> network "net1" does not exist., minorErrorCode=BAD_REQUEST,
>>>> stackTrace=null, vendorSpecificErrorCode=null]} error: [majorErrorCode=400,
>>>> message=The VCD entity network "net1" does not exist.,
>>>> minorErrorCode=BAD_REQUEST, stackTrace=null, vendorSpecificErrorCode=null]
>>>>     at
>>>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:61)
>>>>     at
>>>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:1)
>>>>     at
>>>> org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:111)
>>>>     at
>>>> org.apache.stratos.cloud.controller.iaases.Main.waitForTask(Main.java:177)
>>>>     at
>>>> org.apache.stratos.cloud.controller.iaases.Main.main(Main.java:126)
>>>>
>>>>
>>>>
>>>> [2]
>>>> package org.apache.stratos.cloud.controller.iaases;
>>>> import java.net.URI;import org.apache.stratos.cloud.controller.pojo.IaasProvider;import org.jclouds.compute.ComputeService;import org.jclouds.compute.ComputeServiceContext;import org.jclouds.compute.domain.Template;import org.jclouds.ovf.Network;import org.jclouds.rest.internal.ApiContextImpl;import org.jclouds.vcloud.TaskStillRunningException;import org.jclouds.vcloud.VCloudApi;import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;import org.jclouds.vcloud.compute.strategy.InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn;import org.jclouds.vcloud.domain.NetworkConnection;import org.jclouds.vcloud.domain.NetworkConnectionSection;import org.jclouds.vcloud.domain.NetworkConnectionSection.Builder;import org.jclouds.vcloud.domain.Task;import org.jclouds.vcloud.domain.VApp;import org.jclouds.vcloud.domain.VAppTemplate;import org.jclouds.vcloud.domain.Vm;import org.jclouds.vcloud.domain.network.IpAddressAllocationMode;import org.jclouds.vcloud.domain.network.NetworkConfig;import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
>>>> import static com.google.common.collect.Iterables.find;
>>>> import com.google.common.base.Predicate;import com.google.common.collect.ImmutableSet;
>>>> import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.addNetworkConfig;import static com.google.common.collect.Iterables.get;
>>>> public class IPAssignment {
>>>>
>>>> 	public static void main(String[] args) throws Exception {
>>>> 		IaasProvider iaasProvider = new IaasProvider();
>>>> 		VCloudIaas iaas = new VCloudIaas(iaasProvider);
>>>>
>>>> 		iaasProvider.setType("vcloud");
>>>> 		iaasProvider.setProvider("vcloud");
>>>> 		iaasProvider.setIdentity("***********************");
>>>> 		iaasProvider.setCredential("*********************");
>>>> 		iaasProvider.setImage("https://mycloud.stratogen.sg/api/vAppTemplate/vappTemplate-a2503016-2106-4931-9100-f8759564ee82");
>>>> 		iaasProvider.setProperty("jclouds.endpoint", "https://mycloud.stratogen.sg/api");
>>>> 		iaasProvider.setProperty("jclouds.api-version", "1.5");
>>>> 		iaasProvider.setProperty("jclouds.vcloud.version.schema", "1.5");
>>>> 		iaasProvider.setProperty("autoAssignIp", "false");
>>>>
>>>> 		iaas.buildComputeServiceAndTemplate();
>>>> 		iaasProvider.setIaas(iaas);
>>>> 		Template template = iaasProvider.getTemplate();
>>>> 		ComputeService computeService = iaasProvider.getComputeService();
>>>> 		ComputeServiceContext context = computeService.getContext();
>>>>
>>>> 		InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn starter = context.utils()
>>>> 				.injector()
>>>> 				.getInstance(InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class);
>>>>
>>>> 		ApiContextImpl<VCloudApi> imp = context.unwrap();
>>>> 		VCloudApi api = imp.getApi();
>>>>
>>>> 		VCloudTemplateOptions vOptions = VCloudTemplateOptions.class.cast(template.getOptions());
>>>> 		URI templateId = URI.create(template.getImage().getId());
>>>> 		VAppTemplate vAppTemplate = api.getVAppTemplateApi().getVAppTemplate(templateId);
>>>> 		Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);
>>>> 		NetworkConfig config = starter.networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);
>>>>
>>>> 		InstantiateVAppTemplateOptions options = addNetworkConfig(config);
>>>>
>>>> 		URI VDC = URI.create(template.getLocation().getId());
>>>>
>>>> 		String description = VCloudTemplateOptions.class.cast(template.getOptions()).getDescription();
>>>> 		if (description == null) {
>>>> 			description = "test";
>>>> 		}
>>>>
>>>> 		options.description(description);
>>>> 		options.deploy(false);
>>>> 		options.powerOn(false);
>>>>
>>>> 		VApp vAppResponse = api.getVAppTemplateApi().createVAppInVDCByInstantiatingTemplate("test123", VDC, templateId,
>>>> 				options);
>>>>
>>>> 		waitForTask(starter.successTester, vAppResponse.getTasks().get(0));
>>>>
>>>> 		vAppResponse = api.getVAppApi().getVApp(vAppResponse.getHref());
>>>>
>>>> 		Vm vm = get(vAppResponse.getChildren(), 0);
>>>> 		NetworkConnectionSection net = vm.getNetworkConnectionSection();
>>>>
>>>> 		NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);
>>>>
>>>> 		IpAddressAllocationMode ipAllocationMode = vOptions.getIpAddressAllocationMode();
>>>>
>>>> 		if (ipAllocationMode == null)
>>>> 			ipAllocationMode = toConnect.getIpAddressAllocationMode();
>>>>
>>>> 		if (ipAllocationMode == IpAddressAllocationMode.NONE)
>>>> 			ipAllocationMode = IpAddressAllocationMode.POOL;
>>>>
>>>> 		if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
>>>> 				&& toConnect.getNetwork().equals(networkToConnect.getName())) {
>>>> 		} else {
>>>> 			Builder builder = net.toBuilder();
>>>> 			builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName())
>>>> 					.connected(true).ipAddressAllocationMode(ipAllocationMode).build()));
>>>>
>>>> 			waitForTask(starter.successTester, api.getVmApi()
>>>> 					.updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
>>>>
>>>> 		}
>>>> 	}
>>>>
>>>> 	private static NetworkConnection findWithPoolAllocationOrFirst(NetworkConnectionSection net) {
>>>> 		return find(net.getConnections(), new Predicate<NetworkConnection>() {
>>>>
>>>> 			@Override
>>>> 			public boolean apply(NetworkConnection input) {
>>>> 				return input.getIpAddressAllocationMode() == IpAddressAllocationMode.POOL;
>>>> 			}
>>>>
>>>> 		}, get(net.getConnections(), 0));
>>>> 	}
>>>>
>>>> 	public static void waitForTask(Predicate<URI> successTester, Task task) {
>>>> 		if (!successTester.apply(task.getHref())) {
>>>> 			throw new TaskStillRunningException(task);
>>>> 		}
>>>> 	}
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Apr 9, 2014 at 11:06 AM, Melan Nimesh <me...@apache.org> wrote:
>>>>
>>>>> Hi Manas,
>>>>>
>>>>> DHCP based IP assignment is still an untested scenario on Stratos with
>>>>> vCloud. We are currently looking into it and we will update the thread as
>>>>> progress.
>>>>>
>>>>> Thanks,
>>>>> Melan
>>>>>
>>>>>
>>>>> On Wed, Apr 9, 2014 at 10:44 AM, Manas Padegaonkar -T (mpadegao -
>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>wrote:
>>>>>
>>>>>>  Hi Isuru,
>>>>>>
>>>>>>
>>>>>>
>>>>>> I am able to move one step ahead & now VM Cartridges are getting
>>>>>> Powered-ON & an IP is allocated to them after they got launch by Stratos.
>>>>>>
>>>>>> But I am not convinced with the work-around/configuration-changes
>>>>>> after which this happens. We did only one change as mentioned below:---
>>>>>>
>>>>>>
>>>>>>
>>>>>> “Defined Static-Pool of IPs in the Organization VDC
>>>>>> Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are
>>>>>> using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)”
>>>>>>
>>>>>>
>>>>>>
>>>>>> The strange part is that on the vCloud-Director Web-Console,
>>>>>> VM-Cartridge IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240
>>>>>> but inside VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool
>>>>>> i.e. 6.6.6.10-6.6.6.200.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Attaching screenshot of vCloud-Director.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Manas
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>> *Sent:* Tuesday, April 08, 2014 3:22 PM
>>>>>> *To:* Isuru Perera; dev
>>>>>>
>>>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi Isuru,
>>>>>>
>>>>>>
>>>>>>
>>>>>> I went through this troubleshooting guide yesterday & we have
>>>>>> sufficient IPs available in the dhcp pool.
>>>>>>
>>>>>> I never get any error whenever I manually launch the VMs under the
>>>>>> same Organization VDC.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Manas
>>>>>>
>>>>>>
>>>>>>
>>>>>> *From:* Isuru Perera [mailto:isurup@wso2.com <is...@wso2.com>]
>>>>>> *Sent:* Tuesday, April 08, 2014 1:04 PM
>>>>>> *To:* dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi Manas,
>>>>>>
>>>>>> I analyzed the logs.
>>>>>>
>>>>>> Could you please check why following error appears?
>>>>>>
>>>>>> "There are insufficient IP addresses to complete operation. You need
>>>>>> to add IP addresses to the network that is associated with the object being
>>>>>> created or deployed"
>>>>>>
>>>>>> Please check following.
>>>>>>
>>>>>>
>>>>>> http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
>>>>>>
>>>>>> Possible solution according to docs:
>>>>>>
>>>>>> * Assign additional IP addresses to the network where the application
>>>>>> is being deployed.
>>>>>>
>>>>>> * Delete unwanted deployments from vFabric Application Director to
>>>>>> free some IP addresses and storage space.
>>>>>>
>>>>>> Please check and let us know.
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao -
>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>>>>> wrote:
>>>>>>
>>>>>> Hi Isuru & Sajith,
>>>>>>
>>>>>>
>>>>>>
>>>>>> More detailed logs are attached herewith. Awaiting your reply.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Manas
>>>>>>
>>>>>>
>>>>>>
>>>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>>> HOLDINGS LIMITED at Cisco)
>>>>>> *Sent:* Monday, April 07, 2014 5:21 PM
>>>>>> *To:* dev@stratos.incubator.apache.org
>>>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi Sajith & Isuru
>>>>>>
>>>>>>
>>>>>>
>>>>>> Attached are the wso2carbon logs.
>>>>>>
>>>>>>
>>>>>>
>>>>>> In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC
>>>>>> Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at
>>>>>> Edge-GW which is an interface to outside world(5.5.5.0/24 i/e/
>>>>>> floating IP NW)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Manas
>>>>>>
>>>>>>
>>>>>>
>>>>>> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com <sa...@wso2.com>]
>>>>>>
>>>>>> *Sent:* Monday, April 07, 2014 3:17 PM
>>>>>> *To:* dev@stratos.incubator.apache.org
>>>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>>
>>>>>>
>>>>>>
>>>>>> Hi Manas,
>>>>>>
>>>>>>
>>>>>>
>>>>>> Did you check the stratos log file? If you can please share the log
>>>>>> file found in <Stratos>/repository/logs/wso2carbon.log
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Sajith
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao -
>>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>>>>> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>
>>>>>>
>>>>>> I am using Stratos over vCloud0-Director.
>>>>>>
>>>>>>
>>>>>>
>>>>>> I am able to subscribe to the cartridge from stratos-cli & the VM is
>>>>>> getting created on the vCloud-Director but it remains in Powered-Off state.
>>>>>> Thereafter multiple-vms are getting spawned. When I manually power-on the
>>>>>> Cartridge-VM, it fails to get network configuration & comes up without IP
>>>>>> Address.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Please suggest.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Manas
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> *Sajith Kariyawasam*
>>>>>>
>>>>>> *Senior Software Engineer; WSO2, Inc.*
>>>>>>
>>>>>> *AMIE (SL)*
>>>>>>
>>>>>> *Blog: http://sajithblogs.blogspot.com/
>>>>>> <http://sajithblogs.blogspot.com/>*
>>>>>>
>>>>>> *Mobile: +94772269575 <%2B94772269575>*
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Isuru Perera
>>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>>>>> Lean . Enterprise . Middleware
>>>>>>
>>>>>> about.me/chrishantha
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Melan Nimesh Jayasinghage
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Melan Nimesh Jayasinghage
>>>>
>>>
>>>
>>>
>>> --
>>> Melan Nimesh Jayasinghage
>>>
>>
>>
>>
>> --
>> Lakmal Warusawithana
>> Software Architect; WSO2 Inc.
>> Mobile : +94714289692
>> Blog : http://lakmalsview.blogspot.com/
>>
>>
>
>
> --
> Isuru Perera
> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> about.me/chrishantha
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PPMC Member, Apache Stratos

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Isuru Perera <is...@wso2.com>.
That's great Melan! Please update the thread once you commit the changes.
Then I hope Manas can also test his scenario.

Thanks!


On Wed, Apr 16, 2014 at 11:37 PM, Lakmal Warusawithana <la...@wso2.com>wrote:

> great work Melan!
>
>
> On Wed, Apr 16, 2014 at 10:55 PM, Melan Nimesh <me...@apache.org> wrote:
>
>> Hi All,
>>
>> I was able to fix DHCP based IP assignment issue on VCloud. I will commit
>> the fix after some testing.
>>
>> Thanks,
>> Melan
>>
>>
>> On Fri, Apr 11, 2014 at 1:52 PM, Melan Nimesh <me...@apache.org> wrote:
>>
>>> Hi,
>>>
>>> I tried to assign DHCP based pool to a VM programmatically in power off
>>> mode since vCloud does not allow to change primary network in power on
>>> mode, but I am getting "The VCD entity network does not exist" [1] error,
>>> however it works find if we assign it using vCloud UI. My sample code as
>>> follows, Any idea how to fix this?
>>>
>>>
>>> Thanks,
>>> Melan
>>>
>>> [1]
>>> Exception in thread "main" org.jclouds.vcloud.TaskInErrorStateException:
>>> error on task: {href=
>>> https://mycloud.stratogen.sg/api/task/07bbf27e-df93-4bcd-8231-72b762249bd6,
>>> owner={href=
>>> https://mycloud.stratogen.sg/api/vApp/vm-070d8809-7de1-4d13-a994-494351a75a99,
>>> name=Ubuntu 12.04.3 DHCP_1, type=application/vnd.vmware.vcloud.vm+xml},
>>> operation=Updated Virtual Machine Ubuntu 12.04.3
>>> DHCP_1(070d8809-7de1-4d13-a994-494351a75a99), startTime=Fri Apr 11 12:43:24
>>> IST 2014, endTime=Fri Apr 11 12:43:35 IST 2014, expiryTime=Thu Jul 10
>>> 12:43:24 IST 2014, error=[majorErrorCode=400, message=The VCD entity
>>> network "net1" does not exist., minorErrorCode=BAD_REQUEST,
>>> stackTrace=null, vendorSpecificErrorCode=null]} error: [majorErrorCode=400,
>>> message=The VCD entity network "net1" does not exist.,
>>> minorErrorCode=BAD_REQUEST, stackTrace=null, vendorSpecificErrorCode=null]
>>>     at
>>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:61)
>>>     at
>>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:1)
>>>     at
>>> org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:111)
>>>     at
>>> org.apache.stratos.cloud.controller.iaases.Main.waitForTask(Main.java:177)
>>>     at
>>> org.apache.stratos.cloud.controller.iaases.Main.main(Main.java:126)
>>>
>>>
>>>
>>> [2]
>>> package org.apache.stratos.cloud.controller.iaases;
>>> import java.net.URI;import org.apache.stratos.cloud.controller.pojo.IaasProvider;import org.jclouds.compute.ComputeService;import org.jclouds.compute.ComputeServiceContext;import org.jclouds.compute.domain.Template;import org.jclouds.ovf.Network;import org.jclouds.rest.internal.ApiContextImpl;import org.jclouds.vcloud.TaskStillRunningException;import org.jclouds.vcloud.VCloudApi;import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;import org.jclouds.vcloud.compute.strategy.InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn;import org.jclouds.vcloud.domain.NetworkConnection;import org.jclouds.vcloud.domain.NetworkConnectionSection;import org.jclouds.vcloud.domain.NetworkConnectionSection.Builder;import org.jclouds.vcloud.domain.Task;import org.jclouds.vcloud.domain.VApp;import org.jclouds.vcloud.domain.VAppTemplate;import org.jclouds.vcloud.domain.Vm;import org.jclouds.vcloud.domain.network.IpAddressAllocationMode;import org.jclouds.vcloud.domain.network.NetworkConfig;import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
>>> import static com.google.common.collect.Iterables.find;
>>> import com.google.common.base.Predicate;import com.google.common.collect.ImmutableSet;
>>> import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.addNetworkConfig;import static com.google.common.collect.Iterables.get;
>>> public class IPAssignment {
>>>
>>> 	public static void main(String[] args) throws Exception {
>>> 		IaasProvider iaasProvider = new IaasProvider();
>>> 		VCloudIaas iaas = new VCloudIaas(iaasProvider);
>>>
>>> 		iaasProvider.setType("vcloud");
>>> 		iaasProvider.setProvider("vcloud");
>>> 		iaasProvider.setIdentity("***********************");
>>> 		iaasProvider.setCredential("*********************");
>>> 		iaasProvider.setImage("https://mycloud.stratogen.sg/api/vAppTemplate/vappTemplate-a2503016-2106-4931-9100-f8759564ee82");
>>> 		iaasProvider.setProperty("jclouds.endpoint", "https://mycloud.stratogen.sg/api");
>>> 		iaasProvider.setProperty("jclouds.api-version", "1.5");
>>> 		iaasProvider.setProperty("jclouds.vcloud.version.schema", "1.5");
>>> 		iaasProvider.setProperty("autoAssignIp", "false");
>>>
>>> 		iaas.buildComputeServiceAndTemplate();
>>> 		iaasProvider.setIaas(iaas);
>>> 		Template template = iaasProvider.getTemplate();
>>> 		ComputeService computeService = iaasProvider.getComputeService();
>>> 		ComputeServiceContext context = computeService.getContext();
>>>
>>> 		InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn starter = context.utils()
>>> 				.injector()
>>> 				.getInstance(InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class);
>>>
>>> 		ApiContextImpl<VCloudApi> imp = context.unwrap();
>>> 		VCloudApi api = imp.getApi();
>>>
>>> 		VCloudTemplateOptions vOptions = VCloudTemplateOptions.class.cast(template.getOptions());
>>> 		URI templateId = URI.create(template.getImage().getId());
>>> 		VAppTemplate vAppTemplate = api.getVAppTemplateApi().getVAppTemplate(templateId);
>>> 		Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);
>>> 		NetworkConfig config = starter.networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);
>>>
>>> 		InstantiateVAppTemplateOptions options = addNetworkConfig(config);
>>>
>>> 		URI VDC = URI.create(template.getLocation().getId());
>>>
>>> 		String description = VCloudTemplateOptions.class.cast(template.getOptions()).getDescription();
>>> 		if (description == null) {
>>> 			description = "test";
>>> 		}
>>>
>>> 		options.description(description);
>>> 		options.deploy(false);
>>> 		options.powerOn(false);
>>>
>>> 		VApp vAppResponse = api.getVAppTemplateApi().createVAppInVDCByInstantiatingTemplate("test123", VDC, templateId,
>>> 				options);
>>>
>>> 		waitForTask(starter.successTester, vAppResponse.getTasks().get(0));
>>>
>>> 		vAppResponse = api.getVAppApi().getVApp(vAppResponse.getHref());
>>>
>>> 		Vm vm = get(vAppResponse.getChildren(), 0);
>>> 		NetworkConnectionSection net = vm.getNetworkConnectionSection();
>>>
>>> 		NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);
>>>
>>> 		IpAddressAllocationMode ipAllocationMode = vOptions.getIpAddressAllocationMode();
>>>
>>> 		if (ipAllocationMode == null)
>>> 			ipAllocationMode = toConnect.getIpAddressAllocationMode();
>>>
>>> 		if (ipAllocationMode == IpAddressAllocationMode.NONE)
>>> 			ipAllocationMode = IpAddressAllocationMode.POOL;
>>>
>>> 		if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
>>> 				&& toConnect.getNetwork().equals(networkToConnect.getName())) {
>>> 		} else {
>>> 			Builder builder = net.toBuilder();
>>> 			builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName())
>>> 					.connected(true).ipAddressAllocationMode(ipAllocationMode).build()));
>>>
>>> 			waitForTask(starter.successTester, api.getVmApi()
>>> 					.updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
>>>
>>> 		}
>>> 	}
>>>
>>> 	private static NetworkConnection findWithPoolAllocationOrFirst(NetworkConnectionSection net) {
>>> 		return find(net.getConnections(), new Predicate<NetworkConnection>() {
>>>
>>> 			@Override
>>> 			public boolean apply(NetworkConnection input) {
>>> 				return input.getIpAddressAllocationMode() == IpAddressAllocationMode.POOL;
>>> 			}
>>>
>>> 		}, get(net.getConnections(), 0));
>>> 	}
>>>
>>> 	public static void waitForTask(Predicate<URI> successTester, Task task) {
>>> 		if (!successTester.apply(task.getHref())) {
>>> 			throw new TaskStillRunningException(task);
>>> 		}
>>> 	}
>>> }
>>>
>>>
>>>
>>>
>>> On Wed, Apr 9, 2014 at 11:06 AM, Melan Nimesh <me...@apache.org> wrote:
>>>
>>>> Hi Manas,
>>>>
>>>> DHCP based IP assignment is still an untested scenario on Stratos with
>>>> vCloud. We are currently looking into it and we will update the thread as
>>>> progress.
>>>>
>>>> Thanks,
>>>> Melan
>>>>
>>>>
>>>> On Wed, Apr 9, 2014 at 10:44 AM, Manas Padegaonkar -T (mpadegao -
>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>wrote:
>>>>
>>>>>  Hi Isuru,
>>>>>
>>>>>
>>>>>
>>>>> I am able to move one step ahead & now VM Cartridges are getting
>>>>> Powered-ON & an IP is allocated to them after they got launch by Stratos.
>>>>>
>>>>> But I am not convinced with the work-around/configuration-changes
>>>>> after which this happens. We did only one change as mentioned below:---
>>>>>
>>>>>
>>>>>
>>>>> “Defined Static-Pool of IPs in the Organization VDC
>>>>> Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are
>>>>> using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)”
>>>>>
>>>>>
>>>>>
>>>>> The strange part is that on the vCloud-Director Web-Console,
>>>>> VM-Cartridge IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240
>>>>> but inside VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool
>>>>> i.e. 6.6.6.10-6.6.6.200.
>>>>>
>>>>>
>>>>>
>>>>> Attaching screenshot of vCloud-Director.
>>>>>
>>>>>
>>>>>
>>>>> Regards
>>>>>
>>>>> Manas
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>> HOLDINGS LIMITED at Cisco)
>>>>> *Sent:* Tuesday, April 08, 2014 3:22 PM
>>>>> *To:* Isuru Perera; dev
>>>>>
>>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>
>>>>>
>>>>>
>>>>> Hi Isuru,
>>>>>
>>>>>
>>>>>
>>>>> I went through this troubleshooting guide yesterday & we have
>>>>> sufficient IPs available in the dhcp pool.
>>>>>
>>>>> I never get any error whenever I manually launch the VMs under the
>>>>> same Organization VDC.
>>>>>
>>>>>
>>>>>
>>>>> Regards
>>>>>
>>>>> Manas
>>>>>
>>>>>
>>>>>
>>>>> *From:* Isuru Perera [mailto:isurup@wso2.com <is...@wso2.com>]
>>>>> *Sent:* Tuesday, April 08, 2014 1:04 PM
>>>>> *To:* dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>> HOLDINGS LIMITED at Cisco)
>>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>
>>>>>
>>>>>
>>>>> Hi Manas,
>>>>>
>>>>> I analyzed the logs.
>>>>>
>>>>> Could you please check why following error appears?
>>>>>
>>>>> "There are insufficient IP addresses to complete operation. You need
>>>>> to add IP addresses to the network that is associated with the object being
>>>>> created or deployed"
>>>>>
>>>>> Please check following.
>>>>>
>>>>>
>>>>> http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
>>>>>
>>>>> Possible solution according to docs:
>>>>>
>>>>> * Assign additional IP addresses to the network where the application
>>>>> is being deployed.
>>>>>
>>>>> * Delete unwanted deployments from vFabric Application Director to
>>>>> free some IP addresses and storage space.
>>>>>
>>>>> Please check and let us know.
>>>>>
>>>>> Thanks!
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao -
>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>>>> wrote:
>>>>>
>>>>> Hi Isuru & Sajith,
>>>>>
>>>>>
>>>>>
>>>>> More detailed logs are attached herewith. Awaiting your reply.
>>>>>
>>>>>
>>>>>
>>>>> Regards
>>>>>
>>>>> Manas
>>>>>
>>>>>
>>>>>
>>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>>> HOLDINGS LIMITED at Cisco)
>>>>> *Sent:* Monday, April 07, 2014 5:21 PM
>>>>> *To:* dev@stratos.incubator.apache.org
>>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>
>>>>>
>>>>>
>>>>> Hi Sajith & Isuru
>>>>>
>>>>>
>>>>>
>>>>> Attached are the wso2carbon logs.
>>>>>
>>>>>
>>>>>
>>>>> In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC
>>>>> Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at
>>>>> Edge-GW which is an interface to outside world(5.5.5.0/24 i/e/
>>>>> floating IP NW)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Regards
>>>>>
>>>>> Manas
>>>>>
>>>>>
>>>>>
>>>>> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com <sa...@wso2.com>]
>>>>> *Sent:* Monday, April 07, 2014 3:17 PM
>>>>> *To:* dev@stratos.incubator.apache.org
>>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge
>>>>> VM Is Getting Created But Not Powered-On By Stratos
>>>>>
>>>>>
>>>>>
>>>>> Hi Manas,
>>>>>
>>>>>
>>>>>
>>>>> Did you check the stratos log file? If you can please share the log
>>>>> file found in <Stratos>/repository/logs/wso2carbon.log
>>>>>
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Sajith
>>>>>
>>>>>
>>>>>
>>>>> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao -
>>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>>>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>>
>>>>>
>>>>> I am using Stratos over vCloud0-Director.
>>>>>
>>>>>
>>>>>
>>>>> I am able to subscribe to the cartridge from stratos-cli & the VM is
>>>>> getting created on the vCloud-Director but it remains in Powered-Off state.
>>>>> Thereafter multiple-vms are getting spawned. When I manually power-on the
>>>>> Cartridge-VM, it fails to get network configuration & comes up without IP
>>>>> Address.
>>>>>
>>>>>
>>>>>
>>>>> Please suggest.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Regards
>>>>>
>>>>> Manas
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *Sajith Kariyawasam*
>>>>>
>>>>> *Senior Software Engineer; WSO2, Inc.*
>>>>>
>>>>> *AMIE (SL)*
>>>>>
>>>>> *Blog: http://sajithblogs.blogspot.com/
>>>>> <http://sajithblogs.blogspot.com/>*
>>>>>
>>>>> *Mobile: +94772269575 <%2B94772269575>*
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Isuru Perera
>>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>>>> Lean . Enterprise . Middleware
>>>>>
>>>>> about.me/chrishantha
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Melan Nimesh Jayasinghage
>>>>
>>>
>>>
>>>
>>> --
>>> Melan Nimesh Jayasinghage
>>>
>>
>>
>>
>> --
>> Melan Nimesh Jayasinghage
>>
>
>
>
> --
> Lakmal Warusawithana
> Software Architect; WSO2 Inc.
> Mobile : +94714289692
> Blog : http://lakmalsview.blogspot.com/
>
>


-- 
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Lakmal Warusawithana <la...@wso2.com>.
great work Melan!


On Wed, Apr 16, 2014 at 10:55 PM, Melan Nimesh <me...@apache.org> wrote:

> Hi All,
>
> I was able to fix DHCP based IP assignment issue on VCloud. I will commit
> the fix after some testing.
>
> Thanks,
> Melan
>
>
> On Fri, Apr 11, 2014 at 1:52 PM, Melan Nimesh <me...@apache.org> wrote:
>
>> Hi,
>>
>> I tried to assign DHCP based pool to a VM programmatically in power off
>> mode since vCloud does not allow to change primary network in power on
>> mode, but I am getting "The VCD entity network does not exist" [1] error,
>> however it works find if we assign it using vCloud UI. My sample code as
>> follows, Any idea how to fix this?
>>
>>
>> Thanks,
>> Melan
>>
>> [1]
>> Exception in thread "main" org.jclouds.vcloud.TaskInErrorStateException:
>> error on task: {href=
>> https://mycloud.stratogen.sg/api/task/07bbf27e-df93-4bcd-8231-72b762249bd6,
>> owner={href=
>> https://mycloud.stratogen.sg/api/vApp/vm-070d8809-7de1-4d13-a994-494351a75a99,
>> name=Ubuntu 12.04.3 DHCP_1, type=application/vnd.vmware.vcloud.vm+xml},
>> operation=Updated Virtual Machine Ubuntu 12.04.3
>> DHCP_1(070d8809-7de1-4d13-a994-494351a75a99), startTime=Fri Apr 11 12:43:24
>> IST 2014, endTime=Fri Apr 11 12:43:35 IST 2014, expiryTime=Thu Jul 10
>> 12:43:24 IST 2014, error=[majorErrorCode=400, message=The VCD entity
>> network "net1" does not exist., minorErrorCode=BAD_REQUEST,
>> stackTrace=null, vendorSpecificErrorCode=null]} error: [majorErrorCode=400,
>> message=The VCD entity network "net1" does not exist.,
>> minorErrorCode=BAD_REQUEST, stackTrace=null, vendorSpecificErrorCode=null]
>>     at
>> org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:61)
>>     at org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:1)
>>     at
>> org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:111)
>>     at
>> org.apache.stratos.cloud.controller.iaases.Main.waitForTask(Main.java:177)
>>     at org.apache.stratos.cloud.controller.iaases.Main.main(Main.java:126)
>>
>>
>>
>> [2]
>> package org.apache.stratos.cloud.controller.iaases;
>> import java.net.URI;import org.apache.stratos.cloud.controller.pojo.IaasProvider;import org.jclouds.compute.ComputeService;import org.jclouds.compute.ComputeServiceContext;import org.jclouds.compute.domain.Template;import org.jclouds.ovf.Network;import org.jclouds.rest.internal.ApiContextImpl;import org.jclouds.vcloud.TaskStillRunningException;import org.jclouds.vcloud.VCloudApi;import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;import org.jclouds.vcloud.compute.strategy.InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn;import org.jclouds.vcloud.domain.NetworkConnection;import org.jclouds.vcloud.domain.NetworkConnectionSection;import org.jclouds.vcloud.domain.NetworkConnectionSection.Builder;import org.jclouds.vcloud.domain.Task;import org.jclouds.vcloud.domain.VApp;import org.jclouds.vcloud.domain.VAppTemplate;import org.jclouds.vcloud.domain.Vm;import org.jclouds.vcloud.domain.network.IpAddressAllocationMode;import org.jclouds.vcloud.domain.network.NetworkConfig;import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
>> import static com.google.common.collect.Iterables.find;
>> import com.google.common.base.Predicate;import com.google.common.collect.ImmutableSet;
>> import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.addNetworkConfig;import static com.google.common.collect.Iterables.get;
>> public class IPAssignment {
>>
>> 	public static void main(String[] args) throws Exception {
>> 		IaasProvider iaasProvider = new IaasProvider();
>> 		VCloudIaas iaas = new VCloudIaas(iaasProvider);
>>
>> 		iaasProvider.setType("vcloud");
>> 		iaasProvider.setProvider("vcloud");
>> 		iaasProvider.setIdentity("***********************");
>> 		iaasProvider.setCredential("*********************");
>> 		iaasProvider.setImage("https://mycloud.stratogen.sg/api/vAppTemplate/vappTemplate-a2503016-2106-4931-9100-f8759564ee82");
>> 		iaasProvider.setProperty("jclouds.endpoint", "https://mycloud.stratogen.sg/api");
>> 		iaasProvider.setProperty("jclouds.api-version", "1.5");
>> 		iaasProvider.setProperty("jclouds.vcloud.version.schema", "1.5");
>> 		iaasProvider.setProperty("autoAssignIp", "false");
>>
>> 		iaas.buildComputeServiceAndTemplate();
>> 		iaasProvider.setIaas(iaas);
>> 		Template template = iaasProvider.getTemplate();
>> 		ComputeService computeService = iaasProvider.getComputeService();
>> 		ComputeServiceContext context = computeService.getContext();
>>
>> 		InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn starter = context.utils()
>> 				.injector()
>> 				.getInstance(InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class);
>>
>> 		ApiContextImpl<VCloudApi> imp = context.unwrap();
>> 		VCloudApi api = imp.getApi();
>>
>> 		VCloudTemplateOptions vOptions = VCloudTemplateOptions.class.cast(template.getOptions());
>> 		URI templateId = URI.create(template.getImage().getId());
>> 		VAppTemplate vAppTemplate = api.getVAppTemplateApi().getVAppTemplate(templateId);
>> 		Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);
>> 		NetworkConfig config = starter.networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);
>>
>> 		InstantiateVAppTemplateOptions options = addNetworkConfig(config);
>>
>> 		URI VDC = URI.create(template.getLocation().getId());
>>
>> 		String description = VCloudTemplateOptions.class.cast(template.getOptions()).getDescription();
>> 		if (description == null) {
>> 			description = "test";
>> 		}
>>
>> 		options.description(description);
>> 		options.deploy(false);
>> 		options.powerOn(false);
>>
>> 		VApp vAppResponse = api.getVAppTemplateApi().createVAppInVDCByInstantiatingTemplate("test123", VDC, templateId,
>> 				options);
>>
>> 		waitForTask(starter.successTester, vAppResponse.getTasks().get(0));
>>
>> 		vAppResponse = api.getVAppApi().getVApp(vAppResponse.getHref());
>>
>> 		Vm vm = get(vAppResponse.getChildren(), 0);
>> 		NetworkConnectionSection net = vm.getNetworkConnectionSection();
>>
>> 		NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);
>>
>> 		IpAddressAllocationMode ipAllocationMode = vOptions.getIpAddressAllocationMode();
>>
>> 		if (ipAllocationMode == null)
>> 			ipAllocationMode = toConnect.getIpAddressAllocationMode();
>>
>> 		if (ipAllocationMode == IpAddressAllocationMode.NONE)
>> 			ipAllocationMode = IpAddressAllocationMode.POOL;
>>
>> 		if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
>> 				&& toConnect.getNetwork().equals(networkToConnect.getName())) {
>> 		} else {
>> 			Builder builder = net.toBuilder();
>> 			builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName())
>> 					.connected(true).ipAddressAllocationMode(ipAllocationMode).build()));
>>
>> 			waitForTask(starter.successTester, api.getVmApi()
>> 					.updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
>>
>> 		}
>> 	}
>>
>> 	private static NetworkConnection findWithPoolAllocationOrFirst(NetworkConnectionSection net) {
>> 		return find(net.getConnections(), new Predicate<NetworkConnection>() {
>>
>> 			@Override
>> 			public boolean apply(NetworkConnection input) {
>> 				return input.getIpAddressAllocationMode() == IpAddressAllocationMode.POOL;
>> 			}
>>
>> 		}, get(net.getConnections(), 0));
>> 	}
>>
>> 	public static void waitForTask(Predicate<URI> successTester, Task task) {
>> 		if (!successTester.apply(task.getHref())) {
>> 			throw new TaskStillRunningException(task);
>> 		}
>> 	}
>> }
>>
>>
>>
>>
>> On Wed, Apr 9, 2014 at 11:06 AM, Melan Nimesh <me...@apache.org> wrote:
>>
>>> Hi Manas,
>>>
>>> DHCP based IP assignment is still an untested scenario on Stratos with
>>> vCloud. We are currently looking into it and we will update the thread as
>>> progress.
>>>
>>> Thanks,
>>> Melan
>>>
>>>
>>> On Wed, Apr 9, 2014 at 10:44 AM, Manas Padegaonkar -T (mpadegao -
>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>wrote:
>>>
>>>>  Hi Isuru,
>>>>
>>>>
>>>>
>>>> I am able to move one step ahead & now VM Cartridges are getting
>>>> Powered-ON & an IP is allocated to them after they got launch by Stratos.
>>>>
>>>> But I am not convinced with the work-around/configuration-changes after
>>>> which this happens. We did only one change as mentioned below:---
>>>>
>>>>
>>>>
>>>> “Defined Static-Pool of IPs in the Organization VDC
>>>> Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are
>>>> using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)”
>>>>
>>>>
>>>>
>>>> The strange part is that on the vCloud-Director Web-Console,
>>>> VM-Cartridge IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240
>>>> but inside VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool
>>>> i.e. 6.6.6.10-6.6.6.200.
>>>>
>>>>
>>>>
>>>> Attaching screenshot of vCloud-Director.
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Manas
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
>>>> LIMITED at Cisco)
>>>> *Sent:* Tuesday, April 08, 2014 3:22 PM
>>>> *To:* Isuru Perera; dev
>>>>
>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>>>> Is Getting Created But Not Powered-On By Stratos
>>>>
>>>>
>>>>
>>>> Hi Isuru,
>>>>
>>>>
>>>>
>>>> I went through this troubleshooting guide yesterday & we have
>>>> sufficient IPs available in the dhcp pool.
>>>>
>>>> I never get any error whenever I manually launch the VMs under the same
>>>> Organization VDC.
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Manas
>>>>
>>>>
>>>>
>>>> *From:* Isuru Perera [mailto:isurup@wso2.com <is...@wso2.com>]
>>>> *Sent:* Tuesday, April 08, 2014 1:04 PM
>>>> *To:* dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>>> HOLDINGS LIMITED at Cisco)
>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>>>> Is Getting Created But Not Powered-On By Stratos
>>>>
>>>>
>>>>
>>>> Hi Manas,
>>>>
>>>> I analyzed the logs.
>>>>
>>>> Could you please check why following error appears?
>>>>
>>>> "There are insufficient IP addresses to complete operation. You need to
>>>> add IP addresses to the network that is associated with the object being
>>>> created or deployed"
>>>>
>>>> Please check following.
>>>>
>>>>
>>>> http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
>>>>
>>>> Possible solution according to docs:
>>>>
>>>> * Assign additional IP addresses to the network where the application
>>>> is being deployed.
>>>>
>>>> * Delete unwanted deployments from vFabric Application Director to
>>>> free some IP addresses and storage space.
>>>>
>>>> Please check and let us know.
>>>>
>>>> Thanks!
>>>>
>>>>
>>>>
>>>> On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao -
>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>>> wrote:
>>>>
>>>> Hi Isuru & Sajith,
>>>>
>>>>
>>>>
>>>> More detailed logs are attached herewith. Awaiting your reply.
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Manas
>>>>
>>>>
>>>>
>>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
>>>> LIMITED at Cisco)
>>>> *Sent:* Monday, April 07, 2014 5:21 PM
>>>> *To:* dev@stratos.incubator.apache.org
>>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>>>> Is Getting Created But Not Powered-On By Stratos
>>>>
>>>>
>>>>
>>>> Hi Sajith & Isuru
>>>>
>>>>
>>>>
>>>> Attached are the wso2carbon logs.
>>>>
>>>>
>>>>
>>>> In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC
>>>> Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at Edge-GW
>>>> which is an interface to outside world(5.5.5.0/24 i/e/ floating IP NW)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Manas
>>>>
>>>>
>>>>
>>>> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com <sa...@wso2.com>]
>>>> *Sent:* Monday, April 07, 2014 3:17 PM
>>>> *To:* dev@stratos.incubator.apache.org
>>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>>>> Is Getting Created But Not Powered-On By Stratos
>>>>
>>>>
>>>>
>>>> Hi Manas,
>>>>
>>>>
>>>>
>>>> Did you check the stratos log file? If you can please share the log
>>>> file found in <Stratos>/repository/logs/wso2carbon.log
>>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Sajith
>>>>
>>>>
>>>>
>>>> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao -
>>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>>
>>>>
>>>> I am using Stratos over vCloud0-Director.
>>>>
>>>>
>>>>
>>>> I am able to subscribe to the cartridge from stratos-cli & the VM is
>>>> getting created on the vCloud-Director but it remains in Powered-Off state.
>>>> Thereafter multiple-vms are getting spawned. When I manually power-on the
>>>> Cartridge-VM, it fails to get network configuration & comes up without IP
>>>> Address.
>>>>
>>>>
>>>>
>>>> Please suggest.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Manas
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *Sajith Kariyawasam*
>>>>
>>>> *Senior Software Engineer; WSO2, Inc.*
>>>>
>>>> *AMIE (SL)*
>>>>
>>>> *Blog: http://sajithblogs.blogspot.com/
>>>> <http://sajithblogs.blogspot.com/>*
>>>>
>>>> *Mobile: +94772269575 <%2B94772269575>*
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Isuru Perera
>>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>>> Lean . Enterprise . Middleware
>>>>
>>>> about.me/chrishantha
>>>>
>>>
>>>
>>>
>>> --
>>> Melan Nimesh Jayasinghage
>>>
>>
>>
>>
>> --
>> Melan Nimesh Jayasinghage
>>
>
>
>
> --
> Melan Nimesh Jayasinghage
>



-- 
Lakmal Warusawithana
Software Architect; WSO2 Inc.
Mobile : +94714289692
Blog : http://lakmalsview.blogspot.com/

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Melan Nimesh <me...@apache.org>.
Hi All,

I was able to fix DHCP based IP assignment issue on VCloud. I will commit
the fix after some testing.

Thanks,
Melan


On Fri, Apr 11, 2014 at 1:52 PM, Melan Nimesh <me...@apache.org> wrote:

> Hi,
>
> I tried to assign DHCP based pool to a VM programmatically in power off
> mode since vCloud does not allow to change primary network in power on
> mode, but I am getting "The VCD entity network does not exist" [1] error,
> however it works find if we assign it using vCloud UI. My sample code as
> follows, Any idea how to fix this?
>
>
> Thanks,
> Melan
>
> [1]
> Exception in thread "main" org.jclouds.vcloud.TaskInErrorStateException:
> error on task: {href=
> https://mycloud.stratogen.sg/api/task/07bbf27e-df93-4bcd-8231-72b762249bd6,
> owner={href=
> https://mycloud.stratogen.sg/api/vApp/vm-070d8809-7de1-4d13-a994-494351a75a99,
> name=Ubuntu 12.04.3 DHCP_1, type=application/vnd.vmware.vcloud.vm+xml},
> operation=Updated Virtual Machine Ubuntu 12.04.3
> DHCP_1(070d8809-7de1-4d13-a994-494351a75a99), startTime=Fri Apr 11 12:43:24
> IST 2014, endTime=Fri Apr 11 12:43:35 IST 2014, expiryTime=Thu Jul 10
> 12:43:24 IST 2014, error=[majorErrorCode=400, message=The VCD entity
> network "net1" does not exist., minorErrorCode=BAD_REQUEST,
> stackTrace=null, vendorSpecificErrorCode=null]} error: [majorErrorCode=400,
> message=The VCD entity network "net1" does not exist.,
> minorErrorCode=BAD_REQUEST, stackTrace=null, vendorSpecificErrorCode=null]
>     at org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:61)
>     at org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:1)
>     at
> org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:111)
>     at
> org.apache.stratos.cloud.controller.iaases.Main.waitForTask(Main.java:177)
>     at org.apache.stratos.cloud.controller.iaases.Main.main(Main.java:126)
>
>
>
> [2]
> package org.apache.stratos.cloud.controller.iaases;
> import java.net.URI;import org.apache.stratos.cloud.controller.pojo.IaasProvider;import org.jclouds.compute.ComputeService;import org.jclouds.compute.ComputeServiceContext;import org.jclouds.compute.domain.Template;import org.jclouds.ovf.Network;import org.jclouds.rest.internal.ApiContextImpl;import org.jclouds.vcloud.TaskStillRunningException;import org.jclouds.vcloud.VCloudApi;import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;import org.jclouds.vcloud.compute.strategy.InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn;import org.jclouds.vcloud.domain.NetworkConnection;import org.jclouds.vcloud.domain.NetworkConnectionSection;import org.jclouds.vcloud.domain.NetworkConnectionSection.Builder;import org.jclouds.vcloud.domain.Task;import org.jclouds.vcloud.domain.VApp;import org.jclouds.vcloud.domain.VAppTemplate;import org.jclouds.vcloud.domain.Vm;import org.jclouds.vcloud.domain.network.IpAddressAllocationMode;import org.jclouds.vcloud.domain.network.NetworkConfig;import org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
> import static com.google.common.collect.Iterables.find;
> import com.google.common.base.Predicate;import com.google.common.collect.ImmutableSet;
> import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.addNetworkConfig;import static com.google.common.collect.Iterables.get;
> public class IPAssignment {
>
> 	public static void main(String[] args) throws Exception {
> 		IaasProvider iaasProvider = new IaasProvider();
> 		VCloudIaas iaas = new VCloudIaas(iaasProvider);
>
> 		iaasProvider.setType("vcloud");
> 		iaasProvider.setProvider("vcloud");
> 		iaasProvider.setIdentity("***********************");
> 		iaasProvider.setCredential("*********************");
> 		iaasProvider.setImage("https://mycloud.stratogen.sg/api/vAppTemplate/vappTemplate-a2503016-2106-4931-9100-f8759564ee82");
> 		iaasProvider.setProperty("jclouds.endpoint", "https://mycloud.stratogen.sg/api");
> 		iaasProvider.setProperty("jclouds.api-version", "1.5");
> 		iaasProvider.setProperty("jclouds.vcloud.version.schema", "1.5");
> 		iaasProvider.setProperty("autoAssignIp", "false");
>
> 		iaas.buildComputeServiceAndTemplate();
> 		iaasProvider.setIaas(iaas);
> 		Template template = iaasProvider.getTemplate();
> 		ComputeService computeService = iaasProvider.getComputeService();
> 		ComputeServiceContext context = computeService.getContext();
>
> 		InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn starter = context.utils()
> 				.injector()
> 				.getInstance(InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class);
>
> 		ApiContextImpl<VCloudApi> imp = context.unwrap();
> 		VCloudApi api = imp.getApi();
>
> 		VCloudTemplateOptions vOptions = VCloudTemplateOptions.class.cast(template.getOptions());
> 		URI templateId = URI.create(template.getImage().getId());
> 		VAppTemplate vAppTemplate = api.getVAppTemplateApi().getVAppTemplate(templateId);
> 		Network networkToConnect = get(vAppTemplate.getNetworkSection().getNetworks(), 0);
> 		NetworkConfig config = starter.networkConfigurationForNetworkAndOptions.apply(networkToConnect, vOptions);
>
> 		InstantiateVAppTemplateOptions options = addNetworkConfig(config);
>
> 		URI VDC = URI.create(template.getLocation().getId());
>
> 		String description = VCloudTemplateOptions.class.cast(template.getOptions()).getDescription();
> 		if (description == null) {
> 			description = "test";
> 		}
>
> 		options.description(description);
> 		options.deploy(false);
> 		options.powerOn(false);
>
> 		VApp vAppResponse = api.getVAppTemplateApi().createVAppInVDCByInstantiatingTemplate("test123", VDC, templateId,
> 				options);
>
> 		waitForTask(starter.successTester, vAppResponse.getTasks().get(0));
>
> 		vAppResponse = api.getVAppApi().getVApp(vAppResponse.getHref());
>
> 		Vm vm = get(vAppResponse.getChildren(), 0);
> 		NetworkConnectionSection net = vm.getNetworkConnectionSection();
>
> 		NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);
>
> 		IpAddressAllocationMode ipAllocationMode = vOptions.getIpAddressAllocationMode();
>
> 		if (ipAllocationMode == null)
> 			ipAllocationMode = toConnect.getIpAddressAllocationMode();
>
> 		if (ipAllocationMode == IpAddressAllocationMode.NONE)
> 			ipAllocationMode = IpAddressAllocationMode.POOL;
>
> 		if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
> 				&& toConnect.getNetwork().equals(networkToConnect.getName())) {
> 		} else {
> 			Builder builder = net.toBuilder();
> 			builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName())
> 					.connected(true).ipAddressAllocationMode(ipAllocationMode).build()));
>
> 			waitForTask(starter.successTester, api.getVmApi()
> 					.updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
>
> 		}
> 	}
>
> 	private static NetworkConnection findWithPoolAllocationOrFirst(NetworkConnectionSection net) {
> 		return find(net.getConnections(), new Predicate<NetworkConnection>() {
>
> 			@Override
> 			public boolean apply(NetworkConnection input) {
> 				return input.getIpAddressAllocationMode() == IpAddressAllocationMode.POOL;
> 			}
>
> 		}, get(net.getConnections(), 0));
> 	}
>
> 	public static void waitForTask(Predicate<URI> successTester, Task task) {
> 		if (!successTester.apply(task.getHref())) {
> 			throw new TaskStillRunningException(task);
> 		}
> 	}
> }
>
>
>
>
> On Wed, Apr 9, 2014 at 11:06 AM, Melan Nimesh <me...@apache.org> wrote:
>
>> Hi Manas,
>>
>> DHCP based IP assignment is still an untested scenario on Stratos with
>> vCloud. We are currently looking into it and we will update the thread as
>> progress.
>>
>> Thanks,
>> Melan
>>
>>
>> On Wed, Apr 9, 2014 at 10:44 AM, Manas Padegaonkar -T (mpadegao - ARICENT
>> TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:
>>
>>>  Hi Isuru,
>>>
>>>
>>>
>>> I am able to move one step ahead & now VM Cartridges are getting
>>> Powered-ON & an IP is allocated to them after they got launch by Stratos.
>>>
>>> But I am not convinced with the work-around/configuration-changes after
>>> which this happens. We did only one change as mentioned below:---
>>>
>>>
>>>
>>> “Defined Static-Pool of IPs in the Organization VDC
>>> Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are
>>> using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)”
>>>
>>>
>>>
>>> The strange part is that on the vCloud-Director Web-Console,
>>> VM-Cartridge IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240
>>> but inside VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool
>>> i.e. 6.6.6.10-6.6.6.200.
>>>
>>>
>>>
>>> Attaching screenshot of vCloud-Director.
>>>
>>>
>>>
>>> Regards
>>>
>>> Manas
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
>>> LIMITED at Cisco)
>>> *Sent:* Tuesday, April 08, 2014 3:22 PM
>>> *To:* Isuru Perera; dev
>>>
>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>>> Is Getting Created But Not Powered-On By Stratos
>>>
>>>
>>>
>>> Hi Isuru,
>>>
>>>
>>>
>>> I went through this troubleshooting guide yesterday & we have sufficient
>>> IPs available in the dhcp pool.
>>>
>>> I never get any error whenever I manually launch the VMs under the same
>>> Organization VDC.
>>>
>>>
>>>
>>> Regards
>>>
>>> Manas
>>>
>>>
>>>
>>> *From:* Isuru Perera [mailto:isurup@wso2.com <is...@wso2.com>]
>>> *Sent:* Tuesday, April 08, 2014 1:04 PM
>>> *To:* dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>>> HOLDINGS LIMITED at Cisco)
>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>>> Is Getting Created But Not Powered-On By Stratos
>>>
>>>
>>>
>>> Hi Manas,
>>>
>>> I analyzed the logs.
>>>
>>> Could you please check why following error appears?
>>>
>>> "There are insufficient IP addresses to complete operation. You need to
>>> add IP addresses to the network that is associated with the object being
>>> created or deployed"
>>>
>>> Please check following.
>>>
>>>
>>> http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
>>>
>>> Possible solution according to docs:
>>>
>>> * Assign additional IP addresses to the network where the application is
>>> being deployed.
>>>
>>> * Delete unwanted deployments from vFabric Application Director to free
>>> some IP addresses and storage space.
>>>
>>> Please check and let us know.
>>>
>>> Thanks!
>>>
>>>
>>>
>>> On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao -
>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>> wrote:
>>>
>>> Hi Isuru & Sajith,
>>>
>>>
>>>
>>> More detailed logs are attached herewith. Awaiting your reply.
>>>
>>>
>>>
>>> Regards
>>>
>>> Manas
>>>
>>>
>>>
>>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
>>> LIMITED at Cisco)
>>> *Sent:* Monday, April 07, 2014 5:21 PM
>>> *To:* dev@stratos.incubator.apache.org
>>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>>> Is Getting Created But Not Powered-On By Stratos
>>>
>>>
>>>
>>> Hi Sajith & Isuru
>>>
>>>
>>>
>>> Attached are the wso2carbon logs.
>>>
>>>
>>>
>>> In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC
>>> Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at Edge-GW
>>> which is an interface to outside world(5.5.5.0/24 i/e/ floating IP NW)
>>>
>>>
>>>
>>>
>>>
>>> Regards
>>>
>>> Manas
>>>
>>>
>>>
>>> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com <sa...@wso2.com>]
>>> *Sent:* Monday, April 07, 2014 3:17 PM
>>> *To:* dev@stratos.incubator.apache.org
>>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>>> Is Getting Created But Not Powered-On By Stratos
>>>
>>>
>>>
>>> Hi Manas,
>>>
>>>
>>>
>>> Did you check the stratos log file? If you can please share the log file
>>> found in <Stratos>/repository/logs/wso2carbon.log
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Sajith
>>>
>>>
>>>
>>> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao -
>>> ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>
>>> wrote:
>>>
>>> Hi,
>>>
>>>
>>>
>>> I am using Stratos over vCloud0-Director.
>>>
>>>
>>>
>>> I am able to subscribe to the cartridge from stratos-cli & the VM is
>>> getting created on the vCloud-Director but it remains in Powered-Off state.
>>> Thereafter multiple-vms are getting spawned. When I manually power-on the
>>> Cartridge-VM, it fails to get network configuration & comes up without IP
>>> Address.
>>>
>>>
>>>
>>> Please suggest.
>>>
>>>
>>>
>>>
>>>
>>> Regards
>>>
>>> Manas
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> *Sajith Kariyawasam*
>>>
>>> *Senior Software Engineer; WSO2, Inc.*
>>>
>>> *AMIE (SL)*
>>>
>>> *Blog: http://sajithblogs.blogspot.com/
>>> <http://sajithblogs.blogspot.com/>*
>>>
>>> *Mobile: +94772269575 <%2B94772269575>*
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Isuru Perera
>>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>>> Lean . Enterprise . Middleware
>>>
>>> about.me/chrishantha
>>>
>>
>>
>>
>> --
>> Melan Nimesh Jayasinghage
>>
>
>
>
> --
> Melan Nimesh Jayasinghage
>



-- 
Melan Nimesh Jayasinghage

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Melan Nimesh <me...@apache.org>.
Hi,

I tried to assign DHCP based pool to a VM programmatically in power off
mode since vCloud does not allow to change primary network in power on
mode, but I am getting "The VCD entity network does not exist" [1] error,
however it works find if we assign it using vCloud UI. My sample code as
follows, Any idea how to fix this?


Thanks,
Melan

[1]
Exception in thread "main" org.jclouds.vcloud.TaskInErrorStateException:
error on task: {href=
https://mycloud.stratogen.sg/api/task/07bbf27e-df93-4bcd-8231-72b762249bd6,
owner={href=
https://mycloud.stratogen.sg/api/vApp/vm-070d8809-7de1-4d13-a994-494351a75a99,
name=Ubuntu 12.04.3 DHCP_1, type=application/vnd.vmware.vcloud.vm+xml},
operation=Updated Virtual Machine Ubuntu 12.04.3
DHCP_1(070d8809-7de1-4d13-a994-494351a75a99), startTime=Fri Apr 11 12:43:24
IST 2014, endTime=Fri Apr 11 12:43:35 IST 2014, expiryTime=Thu Jul 10
12:43:24 IST 2014, error=[majorErrorCode=400, message=The VCD entity
network "net1" does not exist., minorErrorCode=BAD_REQUEST,
stackTrace=null, vendorSpecificErrorCode=null]} error: [majorErrorCode=400,
message=The VCD entity network "net1" does not exist.,
minorErrorCode=BAD_REQUEST, stackTrace=null, vendorSpecificErrorCode=null]
    at org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:61)
    at org.jclouds.vcloud.predicates.TaskSuccess.apply(TaskSuccess.java:1)
    at
org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:111)
    at
org.apache.stratos.cloud.controller.iaases.Main.waitForTask(Main.java:177)
    at org.apache.stratos.cloud.controller.iaases.Main.main(Main.java:126)



[2]
package org.apache.stratos.cloud.controller.iaases;
import java.net.URI;import
org.apache.stratos.cloud.controller.pojo.IaasProvider;import
org.jclouds.compute.ComputeService;import
org.jclouds.compute.ComputeServiceContext;import
org.jclouds.compute.domain.Template;import
org.jclouds.ovf.Network;import
org.jclouds.rest.internal.ApiContextImpl;import
org.jclouds.vcloud.TaskStillRunningException;import
org.jclouds.vcloud.VCloudApi;import
org.jclouds.vcloud.compute.options.VCloudTemplateOptions;import
org.jclouds.vcloud.compute.strategy.InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn;import
org.jclouds.vcloud.domain.NetworkConnection;import
org.jclouds.vcloud.domain.NetworkConnectionSection;import
org.jclouds.vcloud.domain.NetworkConnectionSection.Builder;import
org.jclouds.vcloud.domain.Task;import
org.jclouds.vcloud.domain.VApp;import
org.jclouds.vcloud.domain.VAppTemplate;import
org.jclouds.vcloud.domain.Vm;import
org.jclouds.vcloud.domain.network.IpAddressAllocationMode;import
org.jclouds.vcloud.domain.network.NetworkConfig;import
org.jclouds.vcloud.options.InstantiateVAppTemplateOptions;
import static com.google.common.collect.Iterables.find;
import com.google.common.base.Predicate;import
com.google.common.collect.ImmutableSet;
import static org.jclouds.vcloud.options.InstantiateVAppTemplateOptions.Builder.addNetworkConfig;import
static com.google.common.collect.Iterables.get;
public class IPAssignment {

	public static void main(String[] args) throws Exception {
		IaasProvider iaasProvider = new IaasProvider();
		VCloudIaas iaas = new VCloudIaas(iaasProvider);

		iaasProvider.setType("vcloud");
		iaasProvider.setProvider("vcloud");
		iaasProvider.setIdentity("***********************");
		iaasProvider.setCredential("*********************");
		iaasProvider.setImage("https://mycloud.stratogen.sg/api/vAppTemplate/vappTemplate-a2503016-2106-4931-9100-f8759564ee82");
		iaasProvider.setProperty("jclouds.endpoint",
"https://mycloud.stratogen.sg/api");
		iaasProvider.setProperty("jclouds.api-version", "1.5");
		iaasProvider.setProperty("jclouds.vcloud.version.schema", "1.5");
		iaasProvider.setProperty("autoAssignIp", "false");

		iaas.buildComputeServiceAndTemplate();
		iaasProvider.setIaas(iaas);
		Template template = iaasProvider.getTemplate();
		ComputeService computeService = iaasProvider.getComputeService();
		ComputeServiceContext context = computeService.getContext();

		InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn
starter = context.utils()
				.injector()
				.getInstance(InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class);

		ApiContextImpl<VCloudApi> imp = context.unwrap();
		VCloudApi api = imp.getApi();

		VCloudTemplateOptions vOptions =
VCloudTemplateOptions.class.cast(template.getOptions());
		URI templateId = URI.create(template.getImage().getId());
		VAppTemplate vAppTemplate =
api.getVAppTemplateApi().getVAppTemplate(templateId);
		Network networkToConnect =
get(vAppTemplate.getNetworkSection().getNetworks(), 0);
		NetworkConfig config =
starter.networkConfigurationForNetworkAndOptions.apply(networkToConnect,
vOptions);

		InstantiateVAppTemplateOptions options = addNetworkConfig(config);

		URI VDC = URI.create(template.getLocation().getId());

		String description =
VCloudTemplateOptions.class.cast(template.getOptions()).getDescription();
		if (description == null) {
			description = "test";
		}

		options.description(description);
		options.deploy(false);
		options.powerOn(false);

		VApp vAppResponse =
api.getVAppTemplateApi().createVAppInVDCByInstantiatingTemplate("test123",
VDC, templateId,
				options);

		waitForTask(starter.successTester, vAppResponse.getTasks().get(0));

		vAppResponse = api.getVAppApi().getVApp(vAppResponse.getHref());

		Vm vm = get(vAppResponse.getChildren(), 0);
		NetworkConnectionSection net = vm.getNetworkConnectionSection();

		NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);

		IpAddressAllocationMode ipAllocationMode =
vOptions.getIpAddressAllocationMode();

		if (ipAllocationMode == null)
			ipAllocationMode = toConnect.getIpAddressAllocationMode();

		if (ipAllocationMode == IpAddressAllocationMode.NONE)
			ipAllocationMode = IpAddressAllocationMode.POOL;

		if (toConnect.isConnected() &&
toConnect.getIpAddressAllocationMode() == ipAllocationMode
				&& toConnect.getNetwork().equals(networkToConnect.getName())) {
		} else {
			Builder builder = net.toBuilder();
			builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName())
					.connected(true).ipAddressAllocationMode(ipAllocationMode).build()));

			waitForTask(starter.successTester, api.getVmApi()
					.updateNetworkConnectionOfVm(builder.build(), vm.getHref()));

		}
	}

	private static NetworkConnection
findWithPoolAllocationOrFirst(NetworkConnectionSection net) {
		return find(net.getConnections(), new Predicate<NetworkConnection>() {

			@Override
			public boolean apply(NetworkConnection input) {
				return input.getIpAddressAllocationMode() == IpAddressAllocationMode.POOL;
			}

		}, get(net.getConnections(), 0));
	}

	public static void waitForTask(Predicate<URI> successTester, Task task) {
		if (!successTester.apply(task.getHref())) {
			throw new TaskStillRunningException(task);
		}
	}
}




On Wed, Apr 9, 2014 at 11:06 AM, Melan Nimesh <me...@apache.org> wrote:

> Hi Manas,
>
> DHCP based IP assignment is still an untested scenario on Stratos with
> vCloud. We are currently looking into it and we will update the thread as
> progress.
>
> Thanks,
> Melan
>
>
> On Wed, Apr 9, 2014 at 10:44 AM, Manas Padegaonkar -T (mpadegao - ARICENT
> TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:
>
>>  Hi Isuru,
>>
>>
>>
>> I am able to move one step ahead & now VM Cartridges are getting
>> Powered-ON & an IP is allocated to them after they got launch by Stratos.
>>
>> But I am not convinced with the work-around/configuration-changes after
>> which this happens. We did only one change as mentioned below:---
>>
>>
>>
>> "Defined Static-Pool of IPs in the Organization VDC
>> Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are
>> using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)"
>>
>>
>>
>> The strange part is that on the vCloud-Director Web-Console, VM-Cartridge
>> IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240 but inside
>> VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool i.e.
>> 6.6.6.10-6.6.6.200.
>>
>>
>>
>> Attaching screenshot of vCloud-Director.
>>
>>
>>
>> Regards
>>
>> Manas
>>
>>
>>
>>
>>
>>
>>
>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
>> LIMITED at Cisco)
>> *Sent:* Tuesday, April 08, 2014 3:22 PM
>> *To:* Isuru Perera; dev
>>
>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>> Is Getting Created But Not Powered-On By Stratos
>>
>>
>>
>> Hi Isuru,
>>
>>
>>
>> I went through this troubleshooting guide yesterday & we have sufficient
>> IPs available in the dhcp pool.
>>
>> I never get any error whenever I manually launch the VMs under the same
>> Organization VDC.
>>
>>
>>
>> Regards
>>
>> Manas
>>
>>
>>
>> *From:* Isuru Perera [mailto:isurup@wso2.com <is...@wso2.com>]
>> *Sent:* Tuesday, April 08, 2014 1:04 PM
>> *To:* dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES
>> HOLDINGS LIMITED at Cisco)
>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>> Is Getting Created But Not Powered-On By Stratos
>>
>>
>>
>> Hi Manas,
>>
>> I analyzed the logs.
>>
>> Could you please check why following error appears?
>>
>> "There are insufficient IP addresses to complete operation. You need to
>> add IP addresses to the network that is associated with the object being
>> created or deployed"
>>
>> Please check following.
>>
>>
>> http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
>>
>> Possible solution according to docs:
>>
>> * Assign additional IP addresses to the network where the application is
>> being deployed.
>>
>> * Delete unwanted deployments from vFabric Application Director to free
>> some IP addresses and storage space.
>>
>> Please check and let us know.
>>
>> Thanks!
>>
>>
>>
>> On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao - ARICENT
>> TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:
>>
>> Hi Isuru & Sajith,
>>
>>
>>
>> More detailed logs are attached herewith. Awaiting your reply.
>>
>>
>>
>> Regards
>>
>> Manas
>>
>>
>>
>> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
>> LIMITED at Cisco)
>> *Sent:* Monday, April 07, 2014 5:21 PM
>> *To:* dev@stratos.incubator.apache.org
>> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>> Is Getting Created But Not Powered-On By Stratos
>>
>>
>>
>> Hi Sajith & Isuru
>>
>>
>>
>> Attached are the wso2carbon logs.
>>
>>
>>
>> In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC
>> Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at Edge-GW
>> which is an interface to outside world(5.5.5.0/24 i/e/ floating IP NW)
>>
>>
>>
>>
>>
>> Regards
>>
>> Manas
>>
>>
>>
>> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com <sa...@wso2.com>]
>> *Sent:* Monday, April 07, 2014 3:17 PM
>> *To:* dev@stratos.incubator.apache.org
>> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM
>> Is Getting Created But Not Powered-On By Stratos
>>
>>
>>
>> Hi Manas,
>>
>>
>>
>> Did you check the stratos log file? If you can please share the log file
>> found in <Stratos>/repository/logs/wso2carbon.log
>>
>>
>>
>> Thanks,
>>
>> Sajith
>>
>>
>>
>> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao - ARICENT
>> TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:
>>
>> Hi,
>>
>>
>>
>> I am using Stratos over vCloud0-Director.
>>
>>
>>
>> I am able to subscribe to the cartridge from stratos-cli & the VM is
>> getting created on the vCloud-Director but it remains in Powered-Off state.
>> Thereafter multiple-vms are getting spawned. When I manually power-on the
>> Cartridge-VM, it fails to get network configuration & comes up without IP
>> Address.
>>
>>
>>
>> Please suggest.
>>
>>
>>
>>
>>
>> Regards
>>
>> Manas
>>
>>
>>
>>
>>
>> --
>>
>> *Sajith Kariyawasam*
>>
>> *Senior Software Engineer; WSO2, Inc.*
>>
>> *AMIE (SL)*
>>
>> *Blog: http://sajithblogs.blogspot.com/
>> <http://sajithblogs.blogspot.com/>*
>>
>> *Mobile: +94772269575 <%2B94772269575>*
>>
>>
>>
>>
>> --
>>
>> Isuru Perera
>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>> Lean . Enterprise . Middleware
>>
>> about.me/chrishantha
>>
>
>
>
> --
> Melan Nimesh Jayasinghage
>



-- 
Melan Nimesh Jayasinghage

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Melan Nimesh <me...@apache.org>.
Hi Manas,

DHCP based IP assignment is still an untested scenario on Stratos with
vCloud. We are currently looking into it and we will update the thread as
progress.

Thanks,
Melan


On Wed, Apr 9, 2014 at 10:44 AM, Manas Padegaonkar -T (mpadegao - ARICENT
TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:

>  Hi Isuru,
>
>
>
> I am able to move one step ahead & now VM Cartridges are getting
> Powered-ON & an IP is allocated to them after they got launch by Stratos.
>
> But I am not convinced with the work-around/configuration-changes after
> which this happens. We did only one change as mentioned below:---
>
>
>
> "Defined Static-Pool of IPs in the Organization VDC
> Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are
> using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)"
>
>
>
> The strange part is that on the vCloud-Director Web-Console, VM-Cartridge
> IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240 but inside
> VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool i.e.
> 6.6.6.10-6.6.6.200.
>
>
>
> Attaching screenshot of vCloud-Director.
>
>
>
> Regards
>
> Manas
>
>
>
>
>
>
>
> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
> LIMITED at Cisco)
> *Sent:* Tuesday, April 08, 2014 3:22 PM
> *To:* Isuru Perera; dev
>
> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is
> Getting Created But Not Powered-On By Stratos
>
>
>
> Hi Isuru,
>
>
>
> I went through this troubleshooting guide yesterday & we have sufficient
> IPs available in the dhcp pool.
>
> I never get any error whenever I manually launch the VMs under the same
> Organization VDC.
>
>
>
> Regards
>
> Manas
>
>
>
> *From:* Isuru Perera [mailto:isurup@wso2.com <is...@wso2.com>]
> *Sent:* Tuesday, April 08, 2014 1:04 PM
> *To:* dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
> LIMITED at Cisco)
> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is
> Getting Created But Not Powered-On By Stratos
>
>
>
> Hi Manas,
>
> I analyzed the logs.
>
> Could you please check why following error appears?
>
> "There are insufficient IP addresses to complete operation. You need to
> add IP addresses to the network that is associated with the object being
> created or deployed"
>
> Please check following.
>
>
> http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
>
> Possible solution according to docs:
>
> * Assign additional IP addresses to the network where the application is
> being deployed.
>
> * Delete unwanted deployments from vFabric Application Director to free
> some IP addresses and storage space.
>
> Please check and let us know.
>
> Thanks!
>
>
>
> On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao - ARICENT
> TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:
>
> Hi Isuru & Sajith,
>
>
>
> More detailed logs are attached herewith. Awaiting your reply.
>
>
>
> Regards
>
> Manas
>
>
>
> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
> LIMITED at Cisco)
> *Sent:* Monday, April 07, 2014 5:21 PM
> *To:* dev@stratos.incubator.apache.org
> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is
> Getting Created But Not Powered-On By Stratos
>
>
>
> Hi Sajith & Isuru
>
>
>
> Attached are the wso2carbon logs.
>
>
>
> In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC
> Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at Edge-GW
> which is an interface to outside world(5.5.5.0/24 i/e/ floating IP NW)
>
>
>
>
>
> Regards
>
> Manas
>
>
>
> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com <sa...@wso2.com>]
> *Sent:* Monday, April 07, 2014 3:17 PM
> *To:* dev@stratos.incubator.apache.org
> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is
> Getting Created But Not Powered-On By Stratos
>
>
>
> Hi Manas,
>
>
>
> Did you check the stratos log file? If you can please share the log file
> found in <Stratos>/repository/logs/wso2carbon.log
>
>
>
> Thanks,
>
> Sajith
>
>
>
> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao - ARICENT
> TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:
>
> Hi,
>
>
>
> I am using Stratos over vCloud0-Director.
>
>
>
> I am able to subscribe to the cartridge from stratos-cli & the VM is
> getting created on the vCloud-Director but it remains in Powered-Off state.
> Thereafter multiple-vms are getting spawned. When I manually power-on the
> Cartridge-VM, it fails to get network configuration & comes up without IP
> Address.
>
>
>
> Please suggest.
>
>
>
>
>
> Regards
>
> Manas
>
>
>
>
>
> --
>
> *Sajith Kariyawasam*
>
> *Senior Software Engineer; WSO2, Inc.*
>
> *AMIE (SL)*
>
> *Blog: http://sajithblogs.blogspot.com/ <http://sajithblogs.blogspot.com/>*
>
> *Mobile: +94772269575 <%2B94772269575>*
>
>
>
>
> --
>
> Isuru Perera
> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> about.me/chrishantha
>



-- 
Melan Nimesh Jayasinghage

RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by "Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)" <mp...@cisco.com>.
Hi Isuru,

I am able to move one step ahead & now VM Cartridges are getting Powered-ON & an IP is allocated to them after they got launch by Stratos.
But I am not convinced with the work-around/configuration-changes after which this happens. We did only one change as mentioned below:---

"Defined Static-Pool of IPs in the Organization VDC Network(6.6.6.201-6.6.6.240). Earlier there was no IP-Pool there, as we are using DHCP way of allocating IPs from the Dynamic-Pool(6.6.6.10-6.6.6.200)"

The strange part is that on the vCloud-Director Web-Console, VM-Cartridge IPs are from the Static-Pool Range i.e. 6.6.6.201-6.6.6.240 but inside VM-Cartridge, the Interface(eth0) IP is from the Dynamic-Pool i.e. 6.6.6.10-6.6.6.200.

Attaching screenshot of vCloud-Director.

Regards
Manas



From: Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)
Sent: Tuesday, April 08, 2014 3:22 PM
To: Isuru Perera; dev
Subject: RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi Isuru,

I went through this troubleshooting guide yesterday & we have sufficient IPs available in the dhcp pool.
I never get any error whenever I manually launch the VMs under the same Organization VDC.

Regards
Manas

From: Isuru Perera [mailto:isurup@wso2.com]
Sent: Tuesday, April 08, 2014 1:04 PM
To: dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)
Subject: Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi Manas,
I analyzed the logs.
Could you please check why following error appears?

"There are insufficient IP addresses to complete operation. You need to add IP addresses to the network that is associated with the object being created or deployed"
Please check following.

http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
Possible solution according to docs:
* Assign additional IP addresses to the network where the application is being deployed.
* Delete unwanted deployments from vFabric Application Director to free some IP addresses and storage space.
Please check and let us know.
Thanks!

On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>> wrote:
Hi Isuru & Sajith,

More detailed logs are attached herewith. Awaiting your reply.

Regards
Manas

From: Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)
Sent: Monday, April 07, 2014 5:21 PM
To: dev@stratos.incubator.apache.org<ma...@stratos.incubator.apache.org>
Subject: RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi Sajith & Isuru

Attached are the wso2carbon logs.

In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC Network(6.6.6.0/24<http://6.6.6.0/24>) & IP Forwarding & Natting is taken care at Edge-GW which is an interface to outside world(5.5.5.0/24<http://5.5.5.0/24> i/e/ floating IP NW)


Regards
Manas

From: Sajith Kariyawasam [mailto:sajith@wso2.com]
Sent: Monday, April 07, 2014 3:17 PM
To: dev@stratos.incubator.apache.org<ma...@stratos.incubator.apache.org>
Subject: Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi Manas,

Did you check the stratos log file? If you can please share the log file found in <Stratos>/repository/logs/wso2carbon.log

Thanks,
Sajith

On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>> wrote:
Hi,

I am using Stratos over vCloud0-Director.

I am able to subscribe to the cartridge from stratos-cli & the VM is getting created on the vCloud-Director but it remains in Powered-Off state. Thereafter multiple-vms are getting spawned. When I manually power-on the Cartridge-VM, it fails to get network configuration & comes up without IP Address.

Please suggest.


Regards
Manas



--
Sajith Kariyawasam
Senior Software Engineer; WSO2, Inc.
AMIE (SL)
Blog: http://sajithblogs.blogspot.com/
Mobile: +94772269575<tel:%2B94772269575>



--
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha<http://about.me/chrishantha>

RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by "Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)" <mp...@cisco.com>.
Hi Isuru,

I went through this troubleshooting guide yesterday & we have sufficient IPs available in the dhcp pool.
I never get any error whenever I manually launch the VMs under the same Organization VDC.

Regards
Manas

From: Isuru Perera [mailto:isurup@wso2.com]
Sent: Tuesday, April 08, 2014 1:04 PM
To: dev; Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)
Subject: Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi Manas,
I analyzed the logs.
Could you please check why following error appears?

"There are insufficient IP addresses to complete operation. You need to add IP addresses to the network that is associated with the object being created or deployed"
Please check following.

http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html
Possible solution according to docs:
* Assign additional IP addresses to the network where the application is being deployed.
* Delete unwanted deployments from vFabric Application Director to free some IP addresses and storage space.
Please check and let us know.
Thanks!

On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>> wrote:
Hi Isuru & Sajith,

More detailed logs are attached herewith. Awaiting your reply.

Regards
Manas

From: Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)
Sent: Monday, April 07, 2014 5:21 PM
To: dev@stratos.incubator.apache.org<ma...@stratos.incubator.apache.org>
Subject: RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi Sajith & Isuru

Attached are the wso2carbon logs.

In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC Network(6.6.6.0/24<http://6.6.6.0/24>) & IP Forwarding & Natting is taken care at Edge-GW which is an interface to outside world(5.5.5.0/24<http://5.5.5.0/24> i/e/ floating IP NW)


Regards
Manas

From: Sajith Kariyawasam [mailto:sajith@wso2.com]
Sent: Monday, April 07, 2014 3:17 PM
To: dev@stratos.incubator.apache.org<ma...@stratos.incubator.apache.org>
Subject: Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi Manas,

Did you check the stratos log file? If you can please share the log file found in <Stratos>/repository/logs/wso2carbon.log

Thanks,
Sajith

On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>> wrote:
Hi,

I am using Stratos over vCloud0-Director.

I am able to subscribe to the cartridge from stratos-cli & the VM is getting created on the vCloud-Director but it remains in Powered-Off state. Thereafter multiple-vms are getting spawned. When I manually power-on the Cartridge-VM, it fails to get network configuration & comes up without IP Address.

Please suggest.


Regards
Manas



--
Sajith Kariyawasam
Senior Software Engineer; WSO2, Inc.
AMIE (SL)
Blog: http://sajithblogs.blogspot.com/
Mobile: +94772269575<tel:%2B94772269575>



--
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha<http://about.me/chrishantha>

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Isuru Perera <is...@wso2.com>.
Hi Manas,

I analyzed the logs.

Could you please check why following error appears?

"There are insufficient IP addresses to complete operation. You need to add
IP addresses to the network that is associated with the object being
created or deployed"

Please check following.

http://pubs.vmware.com/appdirector-5/index.jsp?topic=%2Fcom.vmware.appdirector5.using.doc%2FGUID-1EF687F2-274C-4BCE-BF01-1A3AE74A2889.html

Possible solution according to docs:

* Assign additional IP addresses to the network where the application is
being deployed.

* Delete unwanted deployments from vFabric Application Director to free
some IP addresses and storage space.

Please check and let us know.

Thanks!


On Tue, Apr 8, 2014 at 11:32 AM, Manas Padegaonkar -T (mpadegao - ARICENT
TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:

>  Hi Isuru & Sajith,
>
>
>
> More detailed logs are attached herewith. Awaiting your reply.
>
>
>
> Regards
>
> Manas
>
>
>
> *From:* Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS
> LIMITED at Cisco)
> *Sent:* Monday, April 07, 2014 5:21 PM
> *To:* dev@stratos.incubator.apache.org
> *Subject:* RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is
> Getting Created But Not Powered-On By Stratos
>
>
>
> Hi Sajith & Isuru
>
>
>
> Attached are the wso2carbon logs.
>
>
>
> In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC
> Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at Edge-GW
> which is an interface to outside world(5.5.5.0/24 i/e/ floating IP NW)
>
>
>
>
>
> Regards
>
> Manas
>
>
>
> *From:* Sajith Kariyawasam [mailto:sajith@wso2.com <sa...@wso2.com>]
> *Sent:* Monday, April 07, 2014 3:17 PM
> *To:* dev@stratos.incubator.apache.org
> *Subject:* Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is
> Getting Created But Not Powered-On By Stratos
>
>
>
> Hi Manas,
>
>
>
> Did you check the stratos log file? If you can please share the log file
> found in <Stratos>/repository/logs/wso2carbon.log
>
>
>
> Thanks,
>
> Sajith
>
>
>
> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao - ARICENT
> TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:
>
> Hi,
>
>
>
> I am using Stratos over vCloud0-Director.
>
>
>
> I am able to subscribe to the cartridge from stratos-cli & the VM is
> getting created on the vCloud-Director but it remains in Powered-Off state.
> Thereafter multiple-vms are getting spawned. When I manually power-on the
> Cartridge-VM, it fails to get network configuration & comes up without IP
> Address.
>
>
>
> Please suggest.
>
>
>
>
>
> Regards
>
> Manas
>
>
>
>
>
> --
>
> *Sajith Kariyawasam*
>
> *Senior Software Engineer; WSO2, Inc.*
>
> *AMIE (SL)*
>
> *Blog: http://sajithblogs.blogspot.com/ <http://sajithblogs.blogspot.com/>*
>
> *Mobile: +94772269575 <%2B94772269575>*
>



-- 
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha

RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by "Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)" <mp...@cisco.com>.
Hi Isuru & Sajith,

More detailed logs are attached herewith. Awaiting your reply.

Regards
Manas

From: Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco)
Sent: Monday, April 07, 2014 5:21 PM
To: dev@stratos.incubator.apache.org
Subject: RE: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi Sajith & Isuru

Attached are the wso2carbon logs.

In my vCloud-Director Setup  VM should get Internal IPs from Org-VDC Network(6.6.6.0/24) & IP Forwarding & Natting is taken care at Edge-GW which is an interface to outside world(5.5.5.0/24 i/e/ floating IP NW)


Regards
Manas

From: Sajith Kariyawasam [mailto:sajith@wso2.com]
Sent: Monday, April 07, 2014 3:17 PM
To: dev@stratos.incubator.apache.org<ma...@stratos.incubator.apache.org>
Subject: Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Hi Manas,

Did you check the stratos log file? If you can please share the log file found in <Stratos>/repository/logs/wso2carbon.log

Thanks,
Sajith

On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao - ARICENT TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com>> wrote:
Hi,

I am using Stratos over vCloud0-Director.

I am able to subscribe to the cartridge from stratos-cli & the VM is getting created on the vCloud-Director but it remains in Powered-Off state. Thereafter multiple-vms are getting spawned. When I manually power-on the Cartridge-VM, it fails to get network configuration & comes up without IP Address.

Please suggest.


Regards
Manas



--
Sajith Kariyawasam
Senior Software Engineer; WSO2, Inc.
AMIE (SL)
Blog: http://sajithblogs.blogspot.com/
Mobile: +94772269575

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Isuru Perera <is...@wso2.com>.
Hi Manas,

When I tested Stratos on vCloud, I didn't encounter similar issues.

We added all steps for creating cartridge on vCloud in our wiki [1].

Did you notice anything different in your vCloud environment. We tested
from a StratoGen account.

As Sajith mentioned, could you please send logs.

Thanks!

[1]
https://cwiki.apache.org/confluence/display/STRATOS/4.0.0+Creating+a+Cartridge+on+vCloud


On Mon, Apr 7, 2014 at 3:17 PM, Sajith Kariyawasam <sa...@wso2.com> wrote:

> Hi Manas,
>
> Did you check the stratos log file? If you can please share the log file
> found in <Stratos>/repository/logs/wso2carbon.log
>
> Thanks,
> Sajith
>
>
> On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao - ARICENT
> TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:
>
>>  Hi,
>>
>>
>>
>> I am using Stratos over vCloud0-Director.
>>
>>
>>
>> I am able to subscribe to the cartridge from stratos-cli & the VM is
>> getting created on the vCloud-Director but it remains in Powered-Off state.
>> Thereafter multiple-vms are getting spawned. When I manually power-on the
>> Cartridge-VM, it fails to get network configuration & comes up without IP
>> Address.
>>
>>
>>
>> Please suggest.
>>
>>
>>
>>
>>
>> Regards
>>
>> Manas
>>
>
>
>
> --
> *Sajith Kariyawasam*
> *Senior Software Engineer; WSO2, Inc.*
> *AMIE (SL)*
> *Blog: http://sajithblogs.blogspot.com/ <http://sajithblogs.blogspot.com/>*
> *Mobile: +94772269575 <%2B94772269575>*
>



-- 
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha

Re: ApacheStratosSingleJVM on vCloud-Director: Cartridge VM Is Getting Created But Not Powered-On By Stratos

Posted by Sajith Kariyawasam <sa...@wso2.com>.
Hi Manas,

Did you check the stratos log file? If you can please share the log file
found in <Stratos>/repository/logs/wso2carbon.log

Thanks,
Sajith


On Mon, Apr 7, 2014 at 12:29 PM, Manas Padegaonkar -T (mpadegao - ARICENT
TECHNOLOGIES HOLDINGS LIMITED at Cisco) <mp...@cisco.com> wrote:

>  Hi,
>
>
>
> I am using Stratos over vCloud0-Director.
>
>
>
> I am able to subscribe to the cartridge from stratos-cli & the VM is
> getting created on the vCloud-Director but it remains in Powered-Off state.
> Thereafter multiple-vms are getting spawned. When I manually power-on the
> Cartridge-VM, it fails to get network configuration & comes up without IP
> Address.
>
>
>
> Please suggest.
>
>
>
>
>
> Regards
>
> Manas
>



-- 
*Sajith Kariyawasam*
*Senior Software Engineer; WSO2, Inc.*
*AMIE (SL)*
*Blog: http://sajithblogs.blogspot.com/ <http://sajithblogs.blogspot.com/>*
*Mobile: +94772269575*