3 Replies Latest reply on May 1, 2013 7:30 AM by BjornNaessens

    Cloned VM : Auto prompt to change Ip address at boot


      I created a template using oracle virtual template builder [with necessary packages], and imported the same into Oracle Virtual manager, i created a VM using this template and it worked well. I made some customizations like kernal parameters, required usernames, auto mount path, added the path whch is made in .bash_profile. After customization, it worked well for one ip [say, with hostname slc03snl10vmb151], I saved this customized template as a "Golden" Template. With this "Golden Template", i created another new VM. But with this new VM, it still points to old ip[i.e and same hostname] Is there a way where we can correct this so that once new VM is created, it should prompt to create new IP and hostname rather than manual modification?

      Thanks in advance.
        • 1. Re: Cloned VM : Auto prompt to change Ip address at boot
          What version of OVM are you using?

          The oracle templates do what you are wanting to do via some "on first boot" scripting/process. If you don't get any good answers here (or don't have time to wait for more responses) I would download a small vm template from Oracle and see if you can leverage what they do (an Oracle minimal Linux OS only Template would be where start)...

          Lately I have been doing multiple 'fork clones' of VMs testing various stages of converting a HVM to HVMwPVd &/or PVM & thus have been creating multiple copies of my original P2V VM template up and running on our network. Each new VM has a new MAC for their NICs & are getting their IPs from DHCP and boot up fine side by side with the same hostnames (I don't care as these are just for testing the booting process as HVM vs HVMwPVd vs PVM).

          With the above recent experience in mind on OVM3.2.1 some thoughts that come to mind off hand are:

          - Before saving your templates, change the host name to a new template host name & template IP so that when you start a new VM based upon that template it comes up without conflict then change it.. I would do that even if you have the vm scripted to change both on first start (scripts sometimes fail)... You can only have 1 new un-renamed/un-reIPed VM up at a time this way but could launch many very quickly serially(one at a time) with minimal wait... This is the way I currently do it (I don't do that many so no need for me to script them)...

          - Alternatively IP-wise, set your templates to dhcp and do first boots to console and change them via scripts/manually then reboot to verify; This should allow multiple VMs to come up at the same time as they would have different dhcp IPs & having multiple hosts up temporarily with the same template hostname on different IPs should be OK.

          - I would compare the "new VM create process from templates" verses "creating new VM as a clone of a regular VM" & see if either one (or both) gives you new MACs automatically. On OVM3.2+ you may find that you prefer to keep your templates as VMs (shutdown) & create new VMs via "Clone Customizers" instead of templates... On OVM3.2.1 the new VMs I have been creating have new VNIC's MACs & thus on first boot kudzu has been picking up the new HW & prompting me to review & address. In kudzu I have then been dropping the old network config & put in the new IPs/etc and then upon boot up changing the hostname and hosts files & then rebooting and verifying everything starts cleanly upon restart. That would at least give you the auto-prompt on the IPs (though not on the host names)... On OVM3.2.1 I have been doing both methods quite a bit lately to create/destroy/re-create VMs for testing & frankly the two methods are blurring together in my memory right now so I can't say for sure if either processes easily result in new NIC MACs... After the new VMs are created via either method I have been logging in via the OVM UI and verifying the VM configs before launching them and can't remember for sure if I have been manually giving new MACs in which methods...

          Sorry I can't do more at this time. Next time I create a copy of a VM I will try to pay closer attention to at least whether the MACs are automated or not and report back...

          Maybe someone else will give you a better answer before then (or you will have grabbed what you need from the Oracle templates that do what you want before then)... If you verify a solution please remember to report back and update this thread with the solution... If you want to download some templates from Oracle to study how they do it I would go to the following URL:


          I would start with something from 'Oracle VM 3 Templates (OVF) for Oracle Linux 6 Media Pack for x86_64 (64 bit)' as there are multiple templates in there & each is about ~500M to download;

          Alternatively you could try "Oracle VM Template for Oracle VM Template Builder Media Pack for x86_64 (64 bit)" & see if you can get an “Just enough OS” (JeOS) VM to focus on...
          • 2. Re: Cloned VM : Auto prompt to change Ip address at boot
            When I create my 'Golden Image', after I'm 100% complete, I run the sys-unconfig command, then power off my VM, and create the template.

            sys-unconfig - shell script to reconfigure the system upon next boot


            sys-unconfig provides a simple method of reconfiguring a system in a new environment. Upon executing sys-unconfig will halt your system, and run the
            following configuration programs at boot: passwd (to change the root password), netconfig, timeconfig, kbdconfig, authconfig, and ntsysv.

            /.unconfigured The presence of this file will cause /etc/rc.d/rc.sysinit to run the programs mentioned above.

            SEE ALSO
            passwd(1), netconfig(8), timeconfig(8), kbdconfig(8), authconfig(8), ntsysv(8)

            H.J. Lu <hjl@valinux.com>

            Wed Jul 28 1999 SYS-UNCONFIG(8)
            • 3. Re: Cloned VM : Auto prompt to change Ip address at boot
              Actually it's pretty simple.
              When you use a template with OVMAPI enabled, you just have to open the file "/etc/sysconfig/ovmd" and set INITIAL_CONFIG to YES. This means that the template will ask all the questions again at boot time like it did the first time.
              If you have a VM that is not OVMAPI enabled, you should install it with up2date or yum. http://docs.oracle.com/cd/E27300_01/E27604/html/vmutl-guestadd-install.html

              When you have these "guest additions" installed you can use ovmd -s cleanup to cleanup all configuration settings ( dns, networking, hostname, ... ), keep in mind that you should do this from the console because you'll loose the network access, and then create a template. ( the INITIAL_CONFIG trick might also work, but I didn't test it )

              Hope this helps.