Skip to end of metadata
Go to start of metadata

Bundling a Windows Instance in the AppNexus Cloud

Bundling a windows instance is a little more complicated than bundling a Linux instance. The API recognizes two kinds of windows images, described below.

Standard Image

This is an image used for launching clones of an original system. I.e. you can use that image in order to launch an arbitrary number of independent instances. To create a standard image from an existing Windows instance in the AppNexus cloud perform the following steps:

1. Reset Administrator's password.

  • Go to Start -> Administrative Tools -> Computer Management -> Local Users And Groups -> Users.
  • Right click on user Administrator.
  • Select Set Password, push Proceed, push OK, leave all input fields empty.

2. Prepare the OS on the original instance. This includes launching the exterior tool sysprep.exe.

  • Go to Start -> Find, find file.
  • Extract to new folder, say C:\sysprep.
  • Run C:\sysprep\sysprep.exe.
  • Select Reseal (leave other settings unchanged).

3. After sysprep.exe completes, the instance will be automatically shut down from within.

4. Wait 1-2 minutes while instance's state is changed to offline. (The manage-instance list command will let you know it is offline.)

Important note: Once offline, the instance becomes totally unavailable. Even the manage-instance restart command would not bring it to life. However, you can now easily bundle this instance. Also note that this statement only applies to standard instances.

5. Bundle the instance using manage-instance bundle command. For example:

manage-instance bundle --instance-id lax1:474 --share-name cust124 
--path images/win2003-customized.img --username <USERNAME>

Bundling instance LAX1:474 (new_windows_instance):
        share: cust124, path: images/win2003-customized.img

Note: You must use the --username parameter to perform CLI commands or else store credentials in rpc.cfg config file instead. Please, refer to API documentation section for details.

Now you can use your custom image in order to launch clones of original system. For example:

manage-instance launch --os w2k3std --name clone --cpu-units 2 --server-id NYM1:17 
--memory 8gb --disk 20gb --share-name cust124 --path images/win2003-customized.img 
--username <USERNAME>

Instance starting:
        id: LAX1:478, IP:

Note: You may use the --admin-password option to set a custom password at launch time. If you do not do this, the API will set a password for you. See Launch a Windows Instance for details.

You can access the newly-launched instance via Microsoft's Remote Desktop Protocol (RDP).

6. Delete the original instance.

manage-instance delete --instance-id LAX1:474 --username <USERNAME>

Backup Image

A backup image is used for the following purposes: restoring of the original system in case of failure, replacement of an original system, launching not a new independent instance. The following attributes on the newly started instance should necessarily be the same for original one: cpu_units, memory, disk, IP address.

In order to create backup image you'll need to execute two CLI commands. Example:

manage-instance shutdown -i LAX1:474 --username <USERNAME>
manage-instance bundle -i LAX1:474 -S cust124 -p images/lax1-474-backup.img --username <USERNAME>

To use a backup image you need to delete the original instance first via manage-instance delete command. To restore the instance, issue the manage-instance launch command, pointing the path option to backup image.

Note: An instance restored from a backup image always has the same Administrator's password as on the original instance, regardless of the auto-generated value displayed in the output of 'manage-instance list -v' command or a value passed via --admin-password optional parameter.

  • No labels