[Openstack] Is there any method to Activate Windows during Launch a new Instance?

Lars Kellogg-Stedman lars at seas.harvard.edu
Sat Nov 3 02:30:27 UTC 2012


On Sat, Nov 03, 2012 at 10:00:40AM +0800, Ray Sun wrote:
>    I create a windows 7 image(without activate) and upload to glance, and I
>    can successfully start it up. But how can I automatically activate it
>    after user launch it? Or how can I inject the SN into windows during
>    startup? Or any other better idea?

If you make the product key available in the user-data attribute, you
can extract it via the scripting language of your choice from
http://169.254.19.254/latest/user-data and then install the key:

  slmgr /ipk <product_key>

And then activate windows:

  slmgr /ato

If the product key is the *only* thing in your user-data attribute,
you can do something like this with PowerShell:

  $web = new-object system.net.webclient
  $data = $web.DownloadString("http://169.254.169.254/latest/user-data")
  slmgr /ipk $data
  slmgr /ato

-- 
Lars Kellogg-Stedman <lars at seas.harvard.edu>  |
Senior Technologist                           | http://ac.seas.harvard.edu/
Academic Computing                            | http://code.seas.harvard.edu/
Harvard School of Engineering                 |
  and Applied Sciences                        |





More information about the Openstack mailing list