[libvirt-users] Is thre any way to change the vm computer name which joined AD

I want to change the computer name of the vm which based on a qcow2 img. virt-win-reg can merge some value when the vm is not joined the AD, but when it joined I tried to do it by virt-win-reg and failed. Any one have any idea about it? -- Focus on: Server Vitualization, Network security,Scanner,NodeJS,JAVA,WWW Blog: http://www.nohouse.net

2012/12/14 Timon Wang <timonwst@gmail.com>
I want to change the computer name of the vm which based on a qcow2 img. virt-win-reg can merge some value when the vm is not joined the AD, but when it joined I tried to do it by virt-win-reg and failed. Any one have any idea about it?
perhaps you can use virt-sysprep ?

This tool only work in linux vm. I have cheked the man page for this tool. Any body knows how to do it in a windows vm which joined a AD domain. On Mon, Dec 24, 2012 at 3:02 PM, Gao Yongwei <itxx00@gmail.com> wrote:
virt-sysprep
-- Focus on: Server Vitualization, Network security,Scanner,NodeJS,JAVA,WWW Blog: http://www.nohouse.net

On Dec 24, 2012 1:48 AM, "Timon Wang" <timonwst@gmail.com> wrote:
This tool only work in linux vm. I have cheked the man page for this tool. Any body knows how to do it in a windows vm which joined a AD domain.
On Mon, Dec 24, 2012 at 3:02 PM, Gao Yongwei <itxx00@gmail.com> wrote:
virt-sysprep
-- Focus on: Server Vitualization, Network security,Scanner,NodeJS,JAVA,WWW Blog: http://www.nohouse.net
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users
Is there a reason you don't rename the system in AD? In past work with AD, I believe a rename in AD console will change a systems hostname. Maybe also have to rename locally to match the modified AD record. - Trey

If a vm join AD domain, the name is registered in the AD server, when I copy a VM, the name will conflict with the source VM. I wanna to know if I can change the VM computer name automaticly. On Mon, Dec 24, 2012 at 4:19 PM, Trey Dockendorf <treydock@gmail.com> wrote:
Maybe also have to rename locally to match the modified AD record.
-- Focus on: Server Vitualization, Network security,Scanner,NodeJS,JAVA,WWW Blog: http://www.nohouse.net

On Mon, Dec 24, 2012 at 3:01 AM, Timon Wang <timonwst@gmail.com> wrote:
If a vm join AD domain, the name is registered in the AD server, when I copy a VM, the name will conflict with the source VM. I wanna to know if I can change the VM computer name automaticly.
On Mon, Dec 24, 2012 at 4:19 PM, Trey Dockendorf <treydock@gmail.com> wrote:
Maybe also have to rename locally to match the modified AD record.
-- Focus on: Server Vitualization, Network security,Scanner,NodeJS,JAVA,WWW Blog: http://www.nohouse.net
Sysprep (used for both live provisioning and cloning) is really the only effective way to clone AD bound systems. Once the cloned system is sysprepped (or the original is sysprepped before cloning) , upon first boot you can rename the system. For windows , if your going to be cloning numerous VMs, I'd recommend looking at OPSI (http://www.opsi.org/) or possibly MDT to do true provisioning. If the overhead to setup either of those is not cost effective, then creating a 'template' VM may be a good alternative. - Trey

How to create a template VM with libvirt? Could you pelease offer me more detail. Many thanks

How to create a template VM with libvirt? Could you pelease offer me more detail. Many thanks
perhaps you could do the following: create a autotask or other things which will run a script at bootup in windows template, after that,when you create a new vm using this template,you can inject the
2012/12/24 Timon Wang <timonwst@gmail.com> script in that vm's disk image,or when the new vm startup,tell it to download the script from a web server,and run the script to change name.

On Dec 24, 2012 5:15 AM, "Timon Wang" <timonwst@gmail.com> wrote:
How to create a template VM with libvirt? Could you pelease offer me more
detail. Many thanks As far as I know there's no defined method or virsh command to do with templates. My reference to templates is more the idea of creating a VM who's purpose is to act as a clone source for future VMs. This system would be configured then sysprepped. The final step of a sysprep is a shutdown, so once shutdown this "template" would remain offline until a change to the base is needed. Any startup of this VM would require another sysprep before being cloned. If more than a handful of clones need to be made I'd recommend looking at OPSI or MDT for provisioning. - Trey

On 12/24/2012 04:01 AM, Timon Wang wrote:
If a vm join AD domain, the name is registered in the AD server, when I copy a VM, the name will conflict with the source VM. I wanna to know if I can change the VM computer name automaticly.
When I (automatically) create my test VM's, I give them hard coded MAC addresses. Then in the anaconda kickstart %post section, I enable a service I called 'transmogrify' that looks at the MAC address, and then bind-mounts the appropriate config files into /etc/ (such as /etc/sysconfig/network containing the hostname). This happens before the network starts. So then I copy this disk image into multiple COW images and boot all test machines from 1 disk image, and they boot and get their individual identities based of the MAC of the VM, which I hardcode in the XML files I use with "virsh define" command. Though this solution obviously is based on running Linux in the VM guests. Paul
participants (4)
-
Gao Yongwei
-
Paul Wouters
-
Timon Wang
-
Trey Dockendorf