13 Replies Latest reply on Aug 13, 2015 10:58 PM by sureshadmin201110141

    vApp, ovf-en.xml - Samples?

    Michelle Laverick Virtuoso

      I understand the new vApp OVF standard allows you to assign a pool of IP address to a vApp.

       

      VMs grab the IP address by having  CD attached to the VM during boot process from which they read a .XML file - (ovf-en.xml?)

       

      Can the Studio assist in making these XML files?

       

      Does anyone have a sample .XML file - and tried this method - to give me some detail on how it all works?

       

      Regards

      Mike Laverick

      RTFM Education

      http://www.rtfm-ed.co.uk

      Author of the SRM Book: http://www.lulu.com/content/4343147

      http://communities.vmware.com/servlet/JiveServlet/download/1200101-20223/vExpert_logo_100x57.jpg

        • 1. Re: vApp, ovf-en.xml - Samples?
          vnagaraja Hot Shot
          VMware Employees

           

          Hi Mike,

           

           

          In general for this to work in vCenter, you'd need to define what is called OVF properties in the OVF descriptor.  This OVF properties lets you specify that an ip address needs to be provided,etc. These properties are exposed to guest/VM either using the CD or using vmware-tools. The XML looks something like this (basically a key value pair). You need to deploy an OVF 1.0 or an OVA with OVF properties into vCenter 4.0.

           

           

          <?xml version="1.0" encoding="UTF-8"?>

          <Environment ....>

          ....

           

           

             <PropertySection>

                   <Property oe:key="vami.ip0.suse_test" oe:value="192.168.1.101"/>

           

           

          .....

             </PropertySection>

          </Environment>

           

           

           

          Now specifically with respect to VMware Studio the networking related OVF properties are generated automatically by Studio during the build process for OVF 1.0 and OVAs for VMs and vApp. You can also specify your own using the Studio's build UI. We use vmware-tools to access these properties and we also configure the networking for you (in the case of Linux VMs only).

           

           

          You can deploy Studio VM using OVF 1.0 /OVA and check it out.

           

           

          You can also run /opt/vmware/share/vami/vami_ovf_process --printovfenv inside of any Linux VM built by Studio to get the OVF Env XML.

           

           

          We will put out more regarding this soon. 

           

           

          Hope this helps,

           

           

          Vishwas

           

           

          • 2. Re: vApp, ovf-en.xml - Samples?
            vnagaraja Hot Shot
            VMware Employees

             

            Support for OVF properties were not present in Studio 1.0. This is supperted in Studio 2.0 beta.

             

             

            It would be great if you could post any further queries to Studio 2.0 beta forum.

             

             

            Thanks,

             

             

            Vishwas

             

             

            • 3. Re: vApp, ovf-en.xml - Samples?
              Michelle Laverick Virtuoso

              Thanks for the response. I have tried to move this thread to a more appropriate location - but I can't locate the Studio community Beta to do that...

               

              I have a couple of questions...

               

              1. Do I have to create an OVF of the vApp before I can set the OVF properties in the OVF descriptor. I notice I can enable vApps properties in there and view (not edit) a .XML file. Can it be done that way...

              2. You mention a CD. What CD? Where? One I create or a default one? What file(s) do I copy? I guess I must have to create this CD myself - and point the VM to it.

              3. The VMware-Tools method sound easier - is there ANY documentation (step-by-step) on how this is done?

              4. You mention some great automation if you using Linux, but if I have Windows in my VM how would I start...

              5. I'm creating my vApps in vCenter - and then exporting it from there. In the past I've had problems re-importing VAs after using vCenter4. It seems to mangle the .ovf properties and mis-report the size of my virtual disks. Do you think I'm better off using Studio for this.

               

              Sorry for all my newbie style questions. But I'm an idiot and like step-by-step guides on how to do things...

               

              Regards

              Mike

               

              vnagaraja wrote:

               

              Hi Mike,

               

               

              In general for this to work in vCenter, you'd need to define what is called OVF properties in the OVF descriptor.  This OVF properties lets you specify that an ip address needs to be provided,etc. These properties are exposed to guest/VM either using the CD or using vmware-tools. The XML looks something like this (basically a key value pair). You need to deploy an OVF 1.0 or an OVA with OVF properties into vCenter 4.0.

               

               

              <?xml version="1.0" encoding="UTF-8"?>

              <Environment ....>

              ....

               

               

                 <PropertySection>

                       <Property oe:key="vami.ip0.suse_test" oe:value="192.168.1.101"/>

               

               

              .....

                 </PropertySection>

              </Environment>

               

               

               

              Now specifically with respect to VMware Studio the networking related OVF properties are generated automatically by Studio during the build process for OVF 1.0 and OVAs for VMs and vApp. You can also specify your own using the Studio's build UI. We use vmware-tools to access these properties and we also configure the networking for you (in the case of Linux VMs only).

               

               

              You can deploy Studio VM using OVF 1.0 /OVA and check it out.

               

               

              You can also run /opt/vmware/share/vami/vami_ovf_process --printovfenv inside of any Linux VM built by Studio to get the OVF Env XML.

               

               

              We will put out more regarding this soon. 

               

               

              Hope this helps,

               

               

              Vishwas

               

               






              Regards

              Mike Laverick

              RTFM Education

              http://www.rtfm-ed.co.uk

              Author of the SRM Book: http://www.lulu.com/content/4343147

              http://communities.vmware.com/servlet/JiveServlet/download/1200101-20223/vExpert_logo_100x57.jpg

              • 4. Re: vApp, ovf-en.xml - Samples?
                Michelle Laverick Virtuoso

                Oh, I should say this for my book on vSphere4. I've writing quite a lot on IP pools on vApps. But if I cannot get an IP allocated to my VM in the vApp - I will be removing the IP pools part from the book....

                 

                I've got sometime to work out how all this works - but I can't prove to myself I can get an IP from the pool - i'd dispense with the section all together.

                 

                Seems like a lot of work just to set an IP address!!!

                 

                Regards

                Mike Laverick

                RTFM Education

                http://www.rtfm-ed.co.uk

                Author of the SRM Book: http://www.lulu.com/content/4343147

                http://communities.vmware.com/servlet/JiveServlet/download/1200101-20223/vExpert_logo_100x57.jpg

                • 5. Re: vApp, ovf-en.xml - Samples?
                  Michelle Laverick Virtuoso

                  I've exported my vApp...

                   

                  Below is the .OVF file properties... I was wondering what I would edit to get my two VMs to grab the IP from the OVF file...

                   

                   

                          <vmw:Level vmw:ecx="x-:-0:0-:-0-R:::-0:-0--" vmw:level="1" />

                          <vmw:Level vmw:ecx="x-::::::-" vmw:level="1" vmw:vendor="amd" />

                          <vmw:Level vmw:edx="--:H-:--:::::--" vmw:level="-2147483647" />

                          <vmw:Level vmw:ecx="--::::00:-00-:--:--" vmw:level="-2147483647" vmw:vendor="amd" />

                         

                          <vmw:Level vmw:ecx="x-:-0:0-:-0-R:::-0:-0--" vmw:level="1" />

                          <vmw:Level vmw:ecx="x-::::::-" vmw:level="1" vmw:vendor="amd" />

                          <vmw:Level vmw:edx="--:H-:--:::::--" vmw:level="-2147483647" />

                          <vmw:Level vmw:ecx="--::::00:-00-:--:--" vmw:level="-2147483647" vmw:vendor="amd" />

                         

                   

                   

                  Regards

                  Mike Laverick

                  RTFM Education

                  http://www.rtfm-ed.co.uk

                  Author of the SRM Book: http://www.lulu.com/content/4343147

                  http://communities.vmware.com/servlet/JiveServlet/download/1200101-20223/vExpert_logo_100x57.jpg

                  • 6. Re: vApp, ovf-en.xml - Samples?
                    chorgeas Hot Shot

                    I have tried to move this thread to a more appropriate location - but I can't locate the Studio community Beta to do that...

                     

                    http://communities.vmware.com/community/beta/studiobeta

                    • 7. Re: vApp, ovf-en.xml - Samples?
                      vnagaraja Hot Shot
                      VMware Employees

                       

                      Well,

                       

                       

                      There are two parts to OVF properties (here is how you can go about adding OVF properties using vSphere 4.0 Client connected to vCenter 4.0).

                       

                       

                      a) An author defining OVF properties in the OVF, from the OVF that you posted below it looks like you don't have any OVF properties. To add some: goto Edit settings-&gt;options tab of the VM, enable vApp options.  Under vApp options -&gt; Advanced, click on Properties.You can define new properties here if the VM is powered down (Ex: an IP property). you don't need IP pool here.

                       

                       

                      b)  Second part is the deployment, when a VM with these properties are deployed, the properties that are defined above are accesible in the guest. This is the ovfEnv.xml. you can access this both with the guest and also in Edit Settings-&gt;Options-&gt;vApp Options-&gt;OVF Settings and View... button to view OVF Environment. The other way to access this is using CD-ROM or vmware tools. Also for networking properties to work here you need to enable IP pool, to do that goto IP Pools tab that is visible when you select your datacenter.

                       

                       

                      You can also look at:  http://blogs.vmware.com/vapp/2009/06/ovf-and-vapps-in-action-.html 

                       

                       

                      More responses inline...

                       

                       

                      1. Do I have to create

                      an OVF of the vApp before I can set the OVF properties in the OVF

                      descriptor. I notice I can enable vApps properties in there and view

                      (not edit) a .XML file. Can it be done that way...

                       

                       

                      OK, hopefully the text above clears this up (you have to goto advanced).

                       

                       

                       

                      2. You mention a CD. What CD? Where? One I create or a default one?

                      What file(s) do I copy? I guess I must have to create this CD myself -

                      and point the VM to it.

                       

                       

                      You need to create a CD-ROM device, and mount it, it will contain the ovfEnv.xml file or you can use vmware-tools.

                       

                       

                      3. The VMware-Tools method sound easier - is there ANY documentation (step-by-step) on how this is done?

                       

                       

                      It is very easy to retrieve the xml from tools, you can query guestInfo.ovfEnv variable (using a command like this: /usr/sbin/vmware-guestd --cmd 'info-get guestinfo.ovfEnv' in Linux, not sure of the windows syntax though)

                       

                       

                      4. You mention some great automation if you using Linux, but if I have Windows in my VM how would I start...

                       

                       

                      For Windows: you would have to write your own first boot script, which can read the ovfEnv.xml and configures the network. 

                       

                       

                      5. I'm creating my vApps in vCenter - and then exporting it from there.

                      In the past I've had problems re-importing VAs after using vCenter4. It

                      seems to mangle the .ovf properties and mis-report the size of my

                      virtual disks. Do you think I'm better off using Studio for this.

                       

                       

                      Yes, using Studio would make it easier, we generate OVF properties even for windows, but there is no in-guest component to consume this xml when the VM boots up. Studio though automates the installation of OS + application, you should try it out.

                       

                       

                       

                       

                       

                      Sorry for all my newbie style questions. But I'm an idiot and like step-by-step guides on how to do things...

                       

                       

                      That is not a problem at all.

                       

                       

                       

                       

                       

                      Vishwas

                       

                       

                      • 8. Re: vApp, ovf-en.xml - Samples?
                        Enthusiast

                        We plan to make a blog post about it soon at:

                         

                        http://blogs.vmware.com/vApp/

                        • 9. Re: vApp, ovf-en.xml - Samples?
                          Michelle Laverick Virtuoso

                          RIGHT!

                           

                          I'm millimeteres away. I've managed to add the custom property to the vApp. Using the CD-ROM method I'm now seeing an IP address in the XML file...

                           

                          WhooHooo!!!

                           

                          Now I'm wondering how I would in Windows parse this XML and get it to set my IP address. I notice only IP address is appearing?

                           

                          What about the other pieces of IP set on the transcient pool such as subnet mask, default gateway and DNS settings?

                           

                          They don't seem to appear on the pull down of the property pages?

                           

                          I had thought of using microsoft netsh but it seems to have its own XML requirements - almost like I'd have to try and make another XML file from the VMware one...???

                           

                          Any pointers?

                           

                          Regards

                          Mike Laverick

                          RTFM Education

                          http://www.rtfm-ed.co.uk

                          Author of the SRM Book: http://www.lulu.com/content/4343147

                          http://communities.vmware.com/servlet/JiveServlet/download/1200101-20223/vExpert_logo_100x57.jpg

                          • 10. Re: vApp, ovf-en.xml - Samples?
                            vnagaraja Hot Shot
                            VMware Employees

                             

                            There are various types of properties that you can define. Look under Type: -&gt; Edit -&gt; Dynamic Property in the property creation wizard in vSphere.

                             

                             

                            Yes, the xml format for ovfEnv is generic and platform agnostic, so you'd have to write something that can consume this xml and configure your network.

                             

                             

                            • 11. Re: vApp, ovf-en.xml - Samples?
                              Michelle Laverick Virtuoso

                              Yes, the xml format for ovfEnv is generic and platform agnostic, so you'd have to write something that can consume this xml and configure your network.

                               

                              Yeah, that's the part in Windows I'm stuck on...

                               

                              Regards

                              Mike Laverick

                              RTFM Education

                              http://www.rtfm-ed.co.uk

                              Author of the SRM Book: http://www.lulu.com/content/4343147

                              http://communities.vmware.com/servlet/JiveServlet/download/1200101-20223/vExpert_logo_100x57.jpg

                              • 12. Re: vApp, ovf-en.xml - Samples?
                                Enthusiast

                                We have posted an example on the vApp blog.

                                • 13. Re: vApp, ovf-en.xml - Samples?
                                  sureshadmin201110141 Enthusiast

                                  Hi Mike,

                                   

                                  Sorry for digging up a old thread.

                                   

                                  Can you please let me know using CD ROM method how you achieved to bring the IP address to XML file step by step? I need this desperately.

                                   

                                  I have configured a VM with OVF properties and connected to a port-group with IPPOOL enabled. If i view the OVF properties i'm not able to see a IP in the XML file, so want to know how this CDROM method works? can you help please.