When a Windows server is attached to a Domain only one instance of it can run at a time. To be able to duplicate the server and start a second instance of it
Create an image of the server
- Remote into the server
- Make sure there is a local administrator account that you can log in with
- Remove it from the domain
- Reboot the server
- In the AWS console create an image of it
- Add the server back to the domain with the same username and password that was used to originally add it to the domain
Launch a new instance
- In the AWS console launch a new instance with the saved image
- Log into the new instance with the local administrator account
- Change the server name (only one server can be added to the domain with the same name)
- Add the server to the domain
- Reboot the server
Bootstrap the new instance in the Chef server
If you configured the original server with Chef, attach the new instance to the Chef server with a new Node Name
- Open a terminal window in the cookbooks directory (below the .kitchen directory, so the Chef kitchen command can find the Chef server configuration)
- Execute the bootstrap command. See Bootstrap Chef nodes to connect them to the Chef server for the details on the bootstrapping process. Don’t forget to use a double backslash (\\) in front of the username.
knife bootstrap windows winrm MY_NODE_IP -x MY_USERNAME -P MY_PASSWORD --node-name THE_NODE_NAME --environment THE_ENVIRONMENT --run-list 'recipe[MY_COOKBOOK1::default],recipe[MY_COOKBOOK2::default]' --json-attributes '{"MY_ATTRIB1":"MY_VALUE1","MY_ATTRIB2":"MY_VALUE2"}' -V