Does the template has vmtools installed on it?
-------- Original message -------- From: lcheng61 <[email protected]> Date: To: jclouds/jclouds <[email protected]> Cc: "Izek Greenfield (igreenfi)" <[email protected]> Subject: Re: [jclouds] Add vSphere support (#364) Hi Izek, Thanks for your help in the past. Now I have a question. I was trying to run some script after the instance is boot up. I used the code as below, as you suggested before. However, I got the error that no IP address is obtained. I checked the instance there's IP assigned. I wonder if the vsphere plugin wait until the IP address is available and is able to get it from the instance ? Do you set the timeout for the waiting ? Which part of code should I take a look ? TemplateOptions o = context.getComputeService().templateOptions(); o.tags(ImmutableSet.of("from UnitTest")) .nodeNames(ImmutableSet.of("first-vm12")) .runScript("cd /tmp; touch test.txt") .networks("VLAN537", "VLAN537") == ava.lang.IllegalStateException: *node does not have IP addresses configured*: {id=first-vm12-from-template, providerId=first-vm12-from-template, uri= https://xxx.xxx.xxx.xxx:9443/vsphere-client/vmrc/vmrc.jsp?vm=urn:vmomi:VirtualMachine:vm-xx-xx-xxxxx, name=first-vm12-from-template, uri= https://xxx.xxx.xxx.xxx:9443/vsphere-client/vmrc/vmrc.jsp?vm=urn:vmomi:VirtualMachine:vm-xxx-xxx-xxx-xxx-xxx, location={scope=HOST, id=, description=}, group=junit-test, status=RUNNING, loginPort=22, hostname=first-vm12-from-template, loginUser=root, tags=[from UnitTest]} == Thanks a lot ! -Liang On Sat, Jun 14, 2014 at 10:16 PM, igreenfield <[email protected]> wrote: > I didn’t test it with OVF. I only used templates. > TemplateBuilder b = context.getComputeService().templateBuilder(); > TemplateOptions o = context.getComputeService().templateOptions(); > o.tags(ImmutableSet.of("from UnitTest")) // you don’t need this if you > don’t want tags. > .nodeNames(ImmutableSet.of("first-vm12")) // the new VM name > .runScript("cd /tmp; touch test.txt") // Just for test that the run script > is working. > .networks("VLAN537", "VLAN537") // Ids of the network you want to add to > the new VM. > ; > // b.imageId("Cisco Centos 6.5").smallest(); > // b.imageId("Cisco Centos 6.5.0").smallest().options(o); > b.imageId("Cisco Centos 6.5") // Template name case-sensitive > .locationId("default") // if you have only one DC you should use “default” > if you have more than one enter here the name of the DC you want to use. > .smallest().options(o); > > > From: lcheng61 [mailto:[email protected]] > Sent: Saturday, June 14, 2014 2:29 AM > To: jclouds/jclouds > Cc: Izek Greenfield (igreenfi) > Subject: Re: [jclouds] Add vSphere support (#364) > > > @igreenfield<https://github.com/igreenfield>, I would like to enable the > unit test at my private environment. I uncommented line 42 and reconfigured > line 49-50 at > > https://github.com/igreenfield/jclouds-labs/blob/master/vsphere/src/test/java/org/jclouds/vsphere/ContextBuilderTest.java > ? > > But I'm not sure how to configure line 56-63. > > On the other hand, how can I load an local ovf file to vsphere server and > power it on ? > > Thanks, > > — > Reply to this email directly or view it on GitHub< > https://github.com/jclouds/jclouds/pull/364#issuecomment-46070591>. > > — > Reply to this email directly or view it on GitHub > <https://github.com/jclouds/jclouds/pull/364#issuecomment-46107248>. > — Reply to this email directly or view it on GitHub<https://github.com/jclouds/jclouds/pull/364#issuecomment-51415586>. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/364#issuecomment-51425643
