New Question
0

Change windows hostname when creating instance from snapshot.

asked 2016-05-20 14:37:44 +0200

Nagesh gravatar image

Hi,

I have created a snapshot of the windows vm in openstack and wanted to have that changed when I create a new instance but I see the hostname remains the same as it was on the original vm from which the snapshot was created. I do not want this, I need to give my own host name for the image that I create out of that snapshot. Can you please assist

edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted
0

answered 2016-05-20 20:30:13 +0200

jrack gravatar image

Did you re-sysprep the VM? I wouldn't just go with changing the hostname of a snap and call it done. Seeing as your didn't get the sysprep random name format my gut says that rearming cloudbase is only one part.

edit flag offensive delete link more

Comments

do you mean to say we have to sysprep the vm before taking snapshot?

Nagesh gravatar imageNagesh ( 2016-05-20 20:33:16 +0200 )edit

I found the way out and your response really helped me to get this done.. I reinstalled the cloudinit and ran the sysprep... after booting the cloudbase forces us to change the pwd... after that I created the snapshot without shutting down the server.

Nagesh gravatar imageNagesh ( 2016-05-21 00:37:46 +0200 )edit
0

answered 2016-05-20 20:25:26 +0200

avladu gravatar image

Hello,

The default behavior of cloudbase-init is to reexecute the plugins, as it uses the new VM id to know if is the case of a snapshot.

In order to debug the issue you are having, can you put on a pastebin the cloudbase-init configuration files and logs?

Thanks.

Adrian.

edit flag offensive delete link more

Comments

Hi Thanks for answering, can you let me know the location fo the cloudbase-init config files pls?

Nagesh gravatar imageNagesh ( 2016-05-20 20:31:46 +0200 )edit

Hi, Please find the logs below: 2016-05-20 07:58:09.513 1336 INFO cloudbaseinit.init [-] Cloudbase-Init version: 0.9.9 2016-05-20 07:58:09.513 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class c:\program files\cloudbase solutions\cl

Nagesh gravatar imageNagesh ( 2016-05-20 20:41:41 +0200 )edit

Hi Adrian, I have put the log file info in the answer above.. pls let me know if it's in readable format.

Nagesh gravatar imageNagesh ( 2016-05-20 20:44:20 +0200 )edit

The logs you provided bellow show that cloudbase-init could not find any usable metadata service. This means that there are issues in your environment with either network configuration or you have not enabled a metadata service. A suggestion would be to enable config-drive (as it is simpler).

avladu gravatar imageavladu ( 2016-05-23 19:17:18 +0200 )edit

Hi, Can you let me know how to enable the config-drive?

Nagesh gravatar imageNagesh ( 2016-05-23 19:54:08 +0200 )edit
0

answered 2016-05-20 20:42:43 +0200

Nagesh gravatar image

Hi, Pls find the logs below: 2016-05-20 07:58:09.513 1336 INFO cloudbaseinit.init [-] Cloudbase-Init version: 0.9.9 2016-05-20 07:58:09.513 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.826 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.mtu.MTUPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.857 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.ntpclient.NTPClientPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.873 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.873 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.createuser.CreateUserPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.888 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.920 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.licensing.WindowsLicensingPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.920 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.920 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.935 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.userdata.UserDataPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.967 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:09.998 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.winrmlistener.ConfigWinRMListenerPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:10.076 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.winrmcertificateauth.ConfigWinRMCertificateAuthPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:10.092 1336 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin' loadclass c:\program files\cloudbase solutions\cloudbase-init\python\lib\site-packages\cloudbaseinit\utils\classloader.py:27 2016-05-20 07:58:10.092 1336 INFO cloudbaseinit.init [-] Executing plugins for stage 'PRENETWORKING': 2016-05-20 07:58:10 ... (more)

edit flag offensive delete link more
0

answered 2016-05-24 09:00:40 +0200

maestropandy gravatar image

Hi,

Snapshot instance will hold hostname of the original image ( i.e the name given while building image from ISO), my answer is to prepare unanswered file xml and feed your hostname else get into cloudbase file and make tee the input, else you can prepare bootstrap script which run along while VM booting

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-05-20 14:37:44 +0200

Seen: 2,699 times

Last updated: May 24 '16