<div dir="ltr"><div><div><div>Hello,<br><br></div>I usually does this :<br><br><a href="http://www.kermit.fr/lofic/snipper/20/">http://www.kermit.fr/lofic/snipper/20/</a><br><br></div>Regards,<br><br></div>Louis Coilliot<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/19 RenĂ© Koch (ovido) <span dir="ltr">&lt;<a href="mailto:r.koch@ovido.at" target="_blank">r.koch@ovido.at</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Has anyone an idea what&#39;s the easiest way to sysprep Linux (CentOS 6 and<br>
RHEL 6) machines?<br>
<br>
The use case is the following: I want to create a lot of virtual<br>
machines (e.g. 100) by cloning from one template.<br>
So I create a master vm, create a template and a pool with 100 vms<br>
assigned to it and set all 100 vms to prestarted.<br>
<br>
The problem is now, that when I run &quot;sys-unconfig&quot; before creating the<br>
template, which does a &quot;touch /.unconfigured&quot; I have to go through the<br>
sysconfig-tui and set a new root password for all 100 hosts.<br>
<br>
So what I&#39;m looking for is a script like the sysprep tool for windows<br>
which sets parameters for me automatically.<br>
I only need to change:<br>
* Hostname + set DHCP_HOSTNAME in ifcfg-eth0 (Hostname == Pool-VM-Name)<br>
for some dhcp/ddns magic :)<br>
* Clear udev network-rules<br>
* remove SSH-Keys<br>
* Remove RHN ID and join Satellite/Spacewalk-server<br>
* root-password,... should stay the same<br>
<br>
My first question is: does oVirt provide such a functionality for Linux<br>
guest out-of-the-box? I couldn&#39;t find one.<br>
<br>
<br>
I think I could solve this with virt-sysprep and virt-file, but I&#39;m<br>
unsure if I can use it with oVirt (or only with plain libvirt):<br>
<a href="http://libguestfs.org/virt-sysprep.1.html" target="_blank">http://libguestfs.org/virt-sysprep.1.html</a><br>
<a href="http://libguestfs.org/virt-edit.1.html" target="_blank">http://libguestfs.org/virt-edit.1.html</a><br>
<br>
For this tools it&#39;s required that the vm is not running, as it changes<br>
files on the disk. If I&#39;m using a before-vm-start hook, it should be<br>
save to access the disk and change content with virt-sysprep/virt-file,<br>
right?<br>
But do I have access to the disk in a before-vm-start hook?<br>
If using NFS storage I should be able to access all disks on the<br>
NFS-share, but for iSCSI/FC-LUNS - are they available on the hypervisor<br>
in this stage?<br>
<br>
<br>
Another option would be to write a custom script which is started during<br>
boot and disables itself after successful run (in the same way as<br>
firstboot - I already have such a script for RHN Satellite/Spacewalk<br>
joins). The problem here is: How do I get the (oVirt) name of this vm<br>
(would need something like virt-whoami :) )? Is the (internal oVirt) ID<br>
of this vm stored somewhere in the filesystem of this vm? I don&#39;t think<br>
so....<br>
<br>
<br>
Thanks a lot for suggestions,<br>
René<br>
<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
</blockquote></div><br></div>