├── .gitignore ├── .vscode ├── analyzersettings.psd1 ├── launch.json └── settings.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── VAMT.psm1 ├── VMwareArchitectureMigrationTool.ps1 ├── example ├── toMigrate.csv └── toMigrate.json └── wiki ├── Design.md ├── QuickStartGuide.md ├── Script_Prerequisites.md ├── Script_Usage.md └── images ├── VAMT-CleanupVMs_1.jpg ├── VAMT-CleanupVMs_2.jpg ├── VAMT-EnablingDRS_1.jpg ├── VAMT-EnablingDRS_2.jpg ├── VAMT-ExampleVMList.jpg ├── VAMT-ExampleVMList_AssignTags_1.jpg ├── VAMT-ExampleVMList_AssignTags_2.jpg ├── VAMT-ExampleVMList_AssignTags_3.jpg ├── VAMT-ExampleVMList_RemoveTags_1.jpg ├── VAMT-MigrateVMs_1.jpg ├── VAMT-MigrateVMs_2.jpg ├── VAMT-MigrateVMs_3.jpg ├── VAMT-MigrateVMs_4.jpg ├── VAMT-MigrateVMs_5.jpg ├── VAMT-MigrateVMs_6.jpg ├── VAMT-RollbackVMs_1.jpg ├── VAMT-RollbackVMs_2.jpg ├── VAMT-RollbackVMs_3.jpg ├── VAMT-Scripting_Tool_Process-cleanup_controller.jpg ├── VAMT-Scripting_Tool_Process-cleanup_process.jpg ├── VAMT-Scripting_Tool_Process-conceptual_model.jpg ├── VAMT-Scripting_Tool_Process-main.jpg ├── VAMT-Scripting_Tool_Process-migrate_process.jpg ├── VAMT-Scripting_Tool_Process-migration_controller_process.jpg ├── VAMT-Scripting_Tool_Process-rollback_controller.jpg ├── VAMT-Scripting_Tool_Process-rollback_process.jpg ├── VAMT-SettingUpTags_1.jpg ├── VAMT-SettingUpTags_2.jpg ├── VAMT-SettingUpTags_3.jpg └── VAMT-SettingUpTags_4.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | vamt_runlogs/ -------------------------------------------------------------------------------- /.vscode/analyzersettings.psd1: -------------------------------------------------------------------------------- 1 | # analyzerSettings.psd1 2 | @{ 3 | ExcludeRules = @( 4 | 'PSAvoidUsingPlainTextForPassword', 5 | 'PSAvoidUsingEmptyCatchBlock', 6 | 'PSAvoidUsingWriteHost', 7 | 'PSUseSingularNouns' 8 | ) 9 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "PowerShell: Launch Current File", 9 | "type": "PowerShell", 10 | "request": "launch", 11 | "script": "${file}", 12 | "args": [] 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powershell.scriptAnalysis.settingsPath": ".vscode/analyzersettings.psd1", 3 | "powershell.scriptAnalysis.enable": true 4 | } -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in vmware-architecture-migration-tool project and our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at oss-coc@vmware.com. 63 | All complaints will be reviewed and investigated promptly and fairly. 64 | 65 | All community leaders are obligated to respect the privacy and security of the 66 | reporter of any incident. 67 | 68 | ## Enforcement Guidelines 69 | 70 | Community leaders will follow these Community Impact Guidelines in determining 71 | the consequences for any action they deem in violation of this Code of Conduct: 72 | 73 | ### 1. Correction 74 | 75 | **Community Impact**: Use of inappropriate language or other behavior deemed 76 | unprofessional or unwelcome in the community. 77 | 78 | **Consequence**: A private, written warning from community leaders, providing 79 | clarity around the nature of the violation and an explanation of why the 80 | behavior was inappropriate. A public apology may be requested. 81 | 82 | ### 2. Warning 83 | 84 | **Community Impact**: A violation through a single incident or series 85 | of actions. 86 | 87 | **Consequence**: A warning with consequences for continued behavior. No 88 | interaction with the people involved, including unsolicited interaction with 89 | those enforcing the Code of Conduct, for a specified period of time. This 90 | includes avoiding interactions in community spaces as well as external channels 91 | like social media. Violating these terms may lead to a temporary or 92 | permanent ban. 93 | 94 | ### 3. Temporary Ban 95 | 96 | **Community Impact**: A serious violation of community standards, including 97 | sustained inappropriate behavior. 98 | 99 | **Consequence**: A temporary ban from any sort of interaction or public 100 | communication with the community for a specified period of time. No public or 101 | private interaction with the people involved, including unsolicited interaction 102 | with those enforcing the Code of Conduct, is allowed during this period. 103 | Violating these terms may lead to a permanent ban. 104 | 105 | ### 4. Permanent Ban 106 | 107 | **Community Impact**: Demonstrating a pattern of violation of community 108 | standards, including sustained inappropriate behavior, harassment of an 109 | individual, or aggression toward or disparagement of classes of individuals. 110 | 111 | **Consequence**: A permanent ban from any sort of public interaction within 112 | the community. 113 | 114 | ## Attribution 115 | 116 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 117 | version 2.0, available at 118 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 119 | 120 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 121 | enforcement ladder](https://github.com/mozilla/diversity). 122 | 123 | [homepage]: https://www.contributor-covenant.org 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | https://www.contributor-covenant.org/faq. Translations are available at 127 | https://www.contributor-covenant.org/translations. 128 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to vmware-architecture-migration-tool 2 | 3 | The vmware-architecture-migration-tool project team welcomes contributions from the community. Before you start working with this project please read and sign our Contributor License Agreement (https://cla.vmware.com/cla/1/preview). If you wish to contribute code and you have not signed our Contributor License Agreement (CLA), our bot will prompt you to do so when you open a Pull Request. For any questions about the CLA process, please refer to our [FAQ](https://cla.vmware.com/faq). 4 | 5 | ## Contribution Flow 6 | 7 | This is a rough outline of what a contributor's workflow looks like: 8 | 9 | - Create a topic branch from where you want to base your work 10 | - Make commits of logical units 11 | - Make sure your commit messages are in the proper format (see below) 12 | - Push your changes to a topic branch in your fork of the repository 13 | - Submit a pull request 14 | 15 | Example: 16 | 17 | ``` shell 18 | git remote add upstream https://github.com/vmware-samples/vmware-architecture-migration-tool.git 19 | git checkout -b my-new-feature main 20 | git commit -a 21 | git push origin my-new-feature 22 | ``` 23 | 24 | ### Staying In Sync With Upstream 25 | 26 | When your branch gets out of sync with the vmware-samples/main branch, use the following to update: 27 | 28 | ``` shell 29 | git checkout my-new-feature 30 | git fetch -a 31 | git pull --rebase upstream main 32 | git push --force-with-lease origin my-new-feature 33 | ``` 34 | 35 | ### Updating pull requests 36 | 37 | If your PR fails to pass CI or needs changes based on code review, you'll most likely want to squash these changes into 38 | existing commits. 39 | 40 | If your pull request contains a single commit or your changes are related to the most recent commit, you can simply 41 | amend the commit. 42 | 43 | ``` shell 44 | git add . 45 | git commit --amend 46 | git push --force-with-lease origin my-new-feature 47 | ``` 48 | 49 | If you need to squash changes into an earlier commit, you can use: 50 | 51 | ``` shell 52 | git add . 53 | git commit --fixup 54 | git rebase -i --autosquash main 55 | git push --force-with-lease origin my-new-feature 56 | ``` 57 | 58 | Be sure to add a comment to the PR indicating your new changes are ready to review, as GitHub does not generate a 59 | notification when you git push. 60 | 61 | ### Code Style 62 | 63 | ### Formatting Commit Messages 64 | 65 | We follow the conventions on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). 66 | 67 | Be sure to include any related GitHub issue references in the commit message. See 68 | [GFM syntax](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) for referencing issues 69 | and commits. 70 | 71 | ## Reporting Bugs and Creating Issues 72 | 73 | When opening a new issue, try to roughly follow the commit message format conventions above. 74 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2022 VMware, Inc. 2 | 3 | This product is licensed to you under the GNU General Public License, V3.0 (the "License"). You may not use this product except in compliance with the License. 4 | 5 | This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VMware Architecture Migration Tool 2 | 3 | ## Getting Started 4 | 5 | Visit our [QuickStart guide](./wiki/QuickStartGuide.md) and explore 6 | our [Table of Contents](#table-of-contents) below to review the project's documentation. 7 | 8 | ## Table of Contents 9 | 10 | - [Getting Started](#getting-started) 11 | - [Purpose](#purpose) 12 | - [Known Limitations](#known-limitations) 13 | - [Design](#design) 14 | - [Prerequisites](#prerequisites) 15 | - [Execution](#execution) 16 | - [Contributing](#contributing) 17 | - [License](#license) 18 | 19 | ## Purpose 20 | 21 | The **V**Mware **A**rchitecture **M**igration **T**ool (VAMT) is designed to provide an easy and automated process to cold migrate machines between clusters of different architecture types within the same vCenter or across vCenter Server instances. In an effort to provide a useful and intuitive tool, the following features have been implemented: 22 | 23 | - **Change Window Support** - Ability to schedule migration within a time frame and stop new migrations if the defined time frame is exceeded. 24 | - **Process Throttling** - Control of how many parallel migrations tasks that vSphere will be asked to execute. 25 | - **Syslog Support** - Ability to send logs to a syslog server. 26 | - **Email Notifications Support** - A report of the logs and individual VM migration status can be sent to an email address. 27 | - **Best Effort Migrated VM Success Validation** - The tool will wait for VMware Tools to load successfully after the VM has been migrated. 28 | - **Extensibility Stubs** - The tool provides a stub of functions to add customization before and after VM is migrated. 29 | - **Maintain the VM's UUID** - In an effort to ensure external tools still recognize the VM after migration the UUID is maintained. 30 | - **Rollback** - Ability to rollback a migration after initial migration execution. 31 | 32 | ## Known Limitations 33 | 34 | Below is a list of known limitations. This by no means can be a complete list as there may be limitations that have not been considered. 35 | 36 | - Designed to be executed from Windows only. 37 | - Rollback process will send VM back to its original vCenter, ESXi host, resource pool, datastore(s), and network(s). Not supporting cluster for rollback allows the widest array of supported scenarios. If rollback target needs to be modified, it can be updated in the VM properties/attributes. 38 | - Migrations will start up until the end of the change window and run until complete, possibly past the defined window. 39 | - Cold migrations initiated by this script are constrained by the limitations and requirements of vSphere & PowerCLI. 40 | - For example, initiating a migration between major vSphere versions (i.e., vSphere 7 -> 8) could have special requirements or limitations that cannot be documented here. 41 | 42 | ## Design 43 | 44 | Visit [Design.md](./wiki/Design.md) to review the details of VAMT's design including: 45 | - [Overview](./wiki/Design.md#overview) 46 | - [Design Philosophy](./wiki/Design.md#philosophy) 47 | - [Conceptual Model](./wiki/Design.md#conceptual-model) 48 | - [Logic Flow Diagrams](./wiki/Design.md#logic-flow-diagrams) 49 | 50 | ## Prerequisites 51 | 52 | Visit [Script_Prerequisites.md](./wiki/Script_Prerequisites.md) to review the prerequisites for running the VAMT. 53 | 54 | ## Execution 55 | 56 | Visit [Script_Usage.md](./wiki/Script_Usage.md) to review the details for running [VMwareArchitectureMigrationTool.ps1](VMwareArchitectureMigrationTool.ps1). 57 | 58 | ## Contributing 59 | 60 | The vmware-architecture-migration-tool project team welcomes contributions from the community. Before you start working with this project please read and sign our Contributor License Agreement (https://cla.vmware.com/cla/1/preview). If you wish to contribute code and you have not signed our Contributor License Agreement (CLA), our bot will prompt you to do so when you open a Pull Request. For any questions about the CLA process, please refer to our [FAQ](https://cla.vmware.com/faq). For more detailed information, refer to [CONTRIBUTING.md](CONTRIBUTING.md). 61 | 62 | ## License 63 | 64 | VMware Architecture Migration Tool is available under the GPL v3.0 license. Please see [LICENSE](LICENSE). 65 | -------------------------------------------------------------------------------- /VMwareArchitectureMigrationTool.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .NOTES 3 | =========================================================================== 4 | Created by: Austin Browder 5 | Date: March 24, 2023 6 | Organization: VMware Professional Services 7 | =========================================================================== 8 | .SYNOPSIS 9 | The VMware Architecture Migration Tool is designed to provide an easy and automated process to 10 | migrate machines between clusters of different architecture types within the same or co-located vCenters. 11 | .DESCRIPTION 12 | Script that performs cold migration on VMs between two compute environments during a specified change window. 13 | .EXAMPLE 14 | $options = @{ 15 | action = "migrate" 16 | inputFilePath = "c:\temp\servers.csv" 17 | changeWindowStart = "6/9/2022 9:16:58" 18 | changeWindowDuration = 180 19 | parallelTaskCount = 5 20 | syslogHost = "192.168.1.14:514" 21 | toEmail = "teamemail@corp.com" 22 | fromEmail = "migrations@corp.com" 23 | debugLogging = $true 24 | } 25 | .\VMwareArchitectureMigrationTool.ps1 @options 26 | #> 27 | 28 | ############################################################################################################################# 29 | # 30 | #region inputs 31 | # 32 | ############################################################################################################################# 33 | 34 | [CmdletBinding(DefaultParameterSetName='Default')] 35 | param( 36 | [Parameter(Mandatory)] 37 | [ValidateSet('migrate','rollback','cleanup')] 38 | [String]$action, 39 | 40 | [Parameter(Mandatory)] 41 | [ValidateNotNullOrEmpty()] 42 | [String]$inputFilePath, 43 | 44 | [Parameter(Mandatory)] <# List of vCenter Hostnames or IPs#> 45 | [ValidateNotNullOrEmpty()] 46 | [String[]]$vCenters, 47 | 48 | [Parameter()] <# Optional: If not set, the user will be prompted for a credential and that credential will be stored (encrypted) on the filesystem. 49 | Note: This is an ordered list that will correspond to the vCenters intput. You can pass 1 credential for all vCenters, or 1 credential per vCenter.#> 50 | [ValidateNotNullOrEmpty()] 51 | [PSCredential[]]$vcCredentials, 52 | 53 | [Parameter()] <# "6/9/2022 9:16:58" #> 54 | [ValidateNotNullOrEmpty()] 55 | [String]$changeWindowStart, 56 | 57 | [Parameter()] <# minutes: default (0) is unlimited #> 58 | [Int]$changeWindowDuration = 0, 59 | 60 | [Parameter()] <# number of concurrent tasks to execute #> 61 | [Int]$parallelTaskCount = 10, 62 | 63 | [Parameter()] <# number of retries that should be attempted if the VM has active vCenter Tasks preventing the migration #> 64 | [Int]$jobRetries = 5, 65 | 66 | [Parameter()] <# Amount of time in seconds to wait when shutting down a guest os before we time out #> 67 | [Int]$osShutdownTimeout = 600, 68 | 69 | [Parameter()] <# Amount of time in seconds to wait for VMtools to start when powering on a VM post migration #> 70 | [Int]$osPowerOnTimeout = 900, 71 | 72 | [Parameter()] <# Amount of time in seconds between job status refreshes #> 73 | [Int]$statusRefreshInterval = 15, 74 | 75 | [Parameter()] <# ip/fqdn:port - port optional #> 76 | [ValidateNotNullOrEmpty()] 77 | [String]$syslogHost, 78 | 79 | [Parameter(Mandatory,ParameterSetName='Email')] <# Optional: ip/fqdn:port - port optional #> 80 | [ValidateNotNullOrEmpty()] 81 | [String]$smtpServer, 82 | 83 | [Parameter(Mandatory,ParameterSetName='Email')] <# Required if smtpServer is specified #> 84 | [ValidateNotNullOrEmpty()] 85 | [String[]]$toEmail, 86 | 87 | [Parameter(Mandatory,ParameterSetName='Email')] <# Required if smtpServer is specified #> 88 | [ValidateNotNullOrEmpty()] 89 | [String]$fromEmail, 90 | 91 | [Parameter(ParameterSetName='Email')] <# Optional #> 92 | [ValidateNotNullOrEmpty()] 93 | [PSCredential]$secureMailCred, 94 | 95 | [Parameter(ParameterSetName='Email')] <# Optional #> 96 | [Switch]$useMailCred, 97 | 98 | [Parameter()] <# do not validate that VMTools is running before starting and do not wait when finished #> 99 | [Switch]$ignoreVmTools, 100 | 101 | [Parameter()] <#CAUTION: this switch skips validation of the tag states on VMs before executing an action #> 102 | [Switch]$ignoreTags, 103 | 104 | [Parameter()] <# force poweroff if initial clean shutdown times out #> 105 | [Switch]$forcePowerOff, 106 | 107 | [Parameter()] <# poweron the VM if rollback occurs #> 108 | [Switch]$powerOnIfRollback, 109 | 110 | [Parameter(ParameterSetName='Email')] <# Optional #> 111 | [Switch]$smtpUseSsl, 112 | 113 | [Parameter()] 114 | [Switch]$debugLogging, 115 | 116 | [Parameter()] <# whatif will establish a connection to the provided vCenter and go through the logic for each machine without actually moving it #> 117 | [Switch]$WhatIf 118 | ) 119 | #endregion 120 | ############################################################################################################################# 121 | 122 | ############################################################################################################################# 123 | # 124 | #region Script Variables 125 | # 126 | ############################################################################################################################# 127 | 128 | #Validate vCenters input 129 | if ($vCenters.count -ne $($vCenters.toLower() | Select-Object -Unique).count) { 130 | throw "Duplicate vCenters found in 'vCenters' inputs." 131 | } 132 | 133 | #Validate vC Credentials and create cred Hash Table 134 | if (($null -eq $vcCredentials) -or ($vcCredentials.count -eq 1) -or ($vcCredentials.count -eq $vCenters.count)) { 135 | $vcCredentialTable = @{} 136 | if ($null -ne $vcCredentials) { 137 | $index = 0 138 | foreach ($vCenter in $vCenters) { 139 | if ($vcCredentials.count -eq 1) { 140 | $vcCredentialTable.Add($vCenter,$vcCredentials[0]) 141 | } else { 142 | $vcCredentialTable.Add($vCenter,$vcCredentials[$index]) 143 | } 144 | $index++ 145 | } 146 | } 147 | } else { 148 | throw "Failed vCenter Credential validation. You must either pass 1 credential for all vCenters; Or 1 credential per vCenter; Or no credentials (local lookup will occur) - $(Get-Date)" 149 | } 150 | 151 | #logging variables 152 | if (![string]::IsNullOrWhiteSpace($syslogHost)) { 153 | $Script:vamtSyslogServer = $syslogHost.Split(":")[0].trim() 154 | if ([string]::IsNullOrEmpty($syslogHost.Split(":")[1])) { 155 | $Script:vamtSyslogPort = 514 156 | } else { 157 | [Int]$Script:vamtSyslogPort = $syslogHost.Split(":")[1].trim() 158 | } 159 | } 160 | #$Script:debugLogging = !!$PSBoundParameters.Debug.IsPresent 161 | $Script:vamtDebugLogging = !!$debugLogging 162 | $Script:vamtCredentialDirectory = "$env:userprofile\documents" 163 | if ([string]::IsNullOrEmpty($PSScriptRoot)) { 164 | $Script:vamtWorkingDirectory = Get-Location | Select-Object -ExpandProperty Path 165 | } else { 166 | $Script:vamtWorkingDirectory = $PSScriptRoot 167 | } 168 | $Script:vamtScriptPath = $MyInvocation.MyCommand.path 169 | $Script:vamtScriptLaunchTime = Get-Date 170 | $Script:vamtLoggingDirectory = "$vamtWorkingDirectory\vamt_runlogs\$($vamtScriptLaunchTime | Get-Date -f "yyyyMMdd-HHmmss")" 171 | $Script:vamtAction = [cultureinfo]::GetCultureInfo("en-US").TextInfo.ToTitleCase($action) 172 | 173 | #email variables 174 | if (![string]::IsNullOrWhiteSpace($smtpServer)) { 175 | $Script:vamtSmtpServer = $smtpServer.Split(":")[0].trim() 176 | if ([string]::IsNullOrEmpty($smtpServer.Split(":")[1])) { 177 | $Script:vamtSmtpPort = 25 178 | } else { 179 | [Int]$Script:vamtSmtpPort = $smtpServer.Split(":")[1].trim() 180 | } 181 | } 182 | if (!!$secureMailCred -or !!$useMailCred) { 183 | $authenticatedEmail = $true 184 | } else { 185 | $authenticatedEmail = $false 186 | } 187 | 188 | #tagging defaults 189 | $Script:vamtTagDetails = @{ 190 | tagCatName = "VAMT" 191 | readyTagName = "readyToMigrate" 192 | inProgressTagName = "inProgress" 193 | completeTagName = "complete" 194 | completeWithErrorsTagName = "completeWithErrors" 195 | failedTagName = "failed" 196 | readyToRollbackTagName = "readyToRollback" 197 | rollbackTagName = "rolledBack" 198 | ignored = "Unknown(Skipped)" 199 | } 200 | 201 | #rollback & auditing VM attributes 202 | $Script:vamtVcAttrDetails = @{ 203 | sourceVcAttribute = "vamtSourcevCenterName" 204 | sourceHostAttribute = "vamtSourceESXiHostId" 205 | sourceRpAttribute = "vamtSourceResourcePoolId" 206 | sourceFolderAttribute = "vamtSourceFolderId" 207 | sourceDsAttribute = "vamtSourceDatastoreId" 208 | sourcePgAttribute = "vamtSourcePortgroupId" 209 | migrationTsAttribute = "vamtLastMigrationTime" 210 | snapshotNameAttribute = "vamtSnapshotName" 211 | } 212 | #job variables 213 | $Script:vamtOsShutdownTimeout = $osShutdownTimeout 214 | $Script:vamtOsPowerOnTimeout = $osPowerOnTimeout 215 | $Script:vamtForceShutdown = (!!$forcePowerOff -or !!$ignoreVmTools) 216 | $Script:vamtPowerOnIfRollback = !!$powerOnIfRollback 217 | $Script:vamtIgnoreVmTools = !!$ignoreVmTools 218 | $Script:vamtIgnoreTags = !!$ignoreTags 219 | 220 | #job controller variables 221 | $jobNotRun = "Not attempted" 222 | $jobInProgress = "Running" 223 | $jobInProgressExternal = "$($vamtTagDetails.inProgressTagName)-External" 224 | $jobComplete = "Completed" 225 | $jobCompleteExternal = "$jobComplete-External" 226 | $jobCompleteWithErrors = "CompletedWithErrors" 227 | $jobCompleteWithErrorsExternal = "$($vamtTagDetails.completeWithErrorsTagName)-External" 228 | $jobFailed = "Failed" 229 | $jobFailedExternal = "$jobFailed-External" 230 | $jobRolledBack = "rolledBack" 231 | $jobRolledBackExternal = "$jobRolledBack-External" 232 | $jobControllerRefreshInterval = $statusRefreshInterval 233 | $jobStates = @{ 234 | completeExternal = $jobCompleteExternal 235 | completeWithErrorsExternal = $jobCompleteWithErrorsExternal 236 | failedExternal = $jobFailedExternal 237 | inProgressExternal = $jobInProgressExternal 238 | rolledBackExternal = $jobRolledBackExternal 239 | jobNotRun = $jobNotRun 240 | } 241 | $Script:doNotRunStates = @( 242 | $jobComplete, 243 | $jobCompleteExternal, 244 | $jobCompleteWithErrors, 245 | $jobCompleteWithErrorsExternal, 246 | $jobFailed, 247 | $jobFailedExternal, 248 | $jobInProgressExternal, 249 | $jobRolledBack, 250 | $jobRolledBackExternal, 251 | $jobNotRun, 252 | "notag" 253 | ) 254 | if ($action -eq "migrate") { 255 | $jobReady = $vamtTagDetails.readyTagName 256 | $doNotRunStates += $vamtTagDetails.readyToRollbackTagName 257 | } elseif ($action -eq "rollback") { 258 | $jobReady = $vamtTagDetails.readyToRollbackTagName 259 | $doNotRunStates += $vamtTagDetails.readyTagName 260 | } 261 | $retryErrors = @( 262 | "Object reference not set to an instance of an object.", 263 | "has already been deleted or has not been completely created", 264 | "Invalid configuration for device", 265 | "Could not complete network copy for file", 266 | "There was no endpoint listening at", 267 | "Could not find any of the objects specified by name", 268 | "Detected invalid tag state ''" 269 | ) -join '|' 270 | 271 | #cleanup variables 272 | $readyToCleanup = "readyToClean" 273 | $cleanupCompleteStates = @($jobComplete, $jobCompleteWithErrors, $jobFailed) 274 | 275 | #inputs csv header defs 276 | $inputHeaders = @{ 277 | name = "vmname" 278 | vcenter = "target_vc" 279 | compute = "target_hostpoolcluster" 280 | network = "target_portgroup" 281 | storage = "target_datastore" 282 | folder = "target_folder" 283 | } 284 | 285 | $scriptVars = (Get-Variable -Scope Script -Include "vamt*") 286 | 287 | #endregion 288 | ############################################################################################################################# 289 | 290 | ############################################################################################################################# 291 | # 292 | #region Setup 293 | # 294 | ############################################################################################################################# 295 | 296 | #Pre-Create log dir 297 | if(!(Test-Path $vamtLoggingDirectory)){ 298 | Write-Host "Creating logging directory for current execution ($vamtLoggingDirectory). - $(Get-Date)" -foregroundColor Cyan 299 | New-Item -Path $vamtLoggingDirectory -ItemType Directory -Force | Out-Null 300 | } 301 | #Stop any hanging transcripts 302 | try { Stop-Transcript } catch {} 303 | Start-Transcript -Path "$vamtLoggingDirectory/transcript-$($vamtScriptLaunchTime | Get-Date -Format FileDateTime).log" 304 | 305 | #Import VAMT functions module 306 | if(!(Test-Path "$vamtWorkingDirectory/VAMT.psm1")){ 307 | throw "VAMT functions module ($vamtWorkingDirectory/VAMT.psm1) was not found. Quiting now. - $(Get-Date)" 308 | } 309 | #Clear the module before import to refresh any changes 310 | Remove-Module "*VAMT*" 311 | Import-Module -Name "$vamtWorkingDirectory/VAMT.psm1" 312 | $PSDefaultParameterValues = @{ 313 | 'Write-Log:logDir' = $vamtLoggingDirectory 314 | 'Write-Log:logFileNamePrefix' = $vamtAction 315 | 'Write-Log:debugLogging' = $vamtDebugLogging 316 | } 317 | if (![string]::IsNullOrEmpty($vamtSyslogServer)) { 318 | $PSDefaultParameterValues.Add('Write-Log:syslogServer', $vamtSyslogServer) 319 | } 320 | if (![string]::IsNullOrEmpty($vamtSyslogPort)) { 321 | $PSDefaultParameterValues.Add('Write-Log:syslogPort', $vamtSyslogPort) 322 | } 323 | Write-Log -logDefaults $PSDefaultParameterValues -severityLevel Info -logMessage "VAMT Module has been imported and logging defaults have been loaded into module." 324 | 325 | #validate inputs 326 | Write-Log -severityLevel Info -logMessage "Beginning inputs file validation." 327 | try { 328 | if ( [IO.Path]::GetExtension($inputFilePath).ToLower() -eq ".json" ) { 329 | $inputs = Get-Content -Raw -Path $inputFilePath | ConvertFrom-Json -ErrorAction Stop 330 | } elseif ( [IO.Path]::GetExtension($inputFilePath).ToLower() -eq ".csv" ) { 331 | $inputs = Import-Csv -Path $inputFilePath 332 | } else { 333 | #No file extension found. 334 | try { 335 | #try json first since it will throw an exception on invalid parse 336 | $inputs = Get-Content -Raw -Path $inputFilePath | ConvertFrom-Json -ErrorAction Stop 337 | } catch { 338 | #failed to parse as a json file to try to import as csv. Issues will be flushed out in validation below. 339 | $inputs = Import-Csv -Path $inputFilePath 340 | } 341 | } 342 | } catch { 343 | Write-Log -severityLevel Error -logMessage "Failed to import inputs file located at '$inputFilePath'. Error:`n`t$($_.Exception.message)" 344 | throw $_ 345 | } 346 | 347 | $errorLines = @() 348 | $inputs | ForEach-Object { 349 | if ( 350 | [String]::IsNullOrWhiteSpace($_."$($inputHeaders.name)") -or 351 | [String]::IsNullOrWhiteSpace($_."$($inputHeaders.vcenter)") -or 352 | [String]::IsNullOrWhiteSpace($_."$($inputHeaders.compute)") -or 353 | [String]::IsNullOrWhiteSpace($_."$($inputHeaders.network)") -or 354 | [String]::IsNullOrWhiteSpace($_."$($inputHeaders.storage)") 355 | #No need to check folder as it's not required. 356 | ) { 357 | $errorLines += [String]($inputs.IndexOf($_)+1) 358 | } 359 | } 360 | 361 | if ($errorLines.Length -gt 0) { 362 | $message = "Missing data detected on object/line(s) ($($errorLines -join ', ')) in inputs file." 363 | Write-Log -severityLevel Error -logMessage $message 364 | throw $message 365 | } 366 | 367 | $vmnames = $inputs.vmname | Select-Object -Unique 368 | $duplicates = Compare-object -referenceobject $inputs.vmname -differenceobject $vmnames 369 | if ($duplicates.InputObject.Length -gt 0) { 370 | $message = "The following VM names were found more than once ($(($duplicates.InputObject | Sort-Object | Get-Unique) -join ', ')) in the inputs file." 371 | Write-Log -severityLevel Error -logMessage $message 372 | throw $message 373 | } 374 | 375 | Write-Log -severityLevel Info -logMessage "Inputs file successfully validated for completeness." 376 | 377 | #Setup and validate email credential 378 | if ($authenticatedEmail) { 379 | Write-Log -severityLevel Info -logMessage "Authenticated email specified, retrieving and/or storing credentials." 380 | if (!$secureMailCred) { 381 | $emailCredential = Get-StoredCredential -credName $fromEmail -credentialDirectory $vamtCredentialDirectory 382 | } else { 383 | $emailCredential = Save-Credential -credName $fromEmail -cred $secureMailCred -credentialDirectory $vamtCredentialDirectory 384 | } 385 | } 386 | 387 | #First clear any active or stale VI Connections from this session. 388 | try { Disconnect-VIServer * -Confirm:$false } catch {} 389 | $viConnections = $vCenters | ForEach-Object { 390 | Initialize-VIServer -vCenters $_ -Credential $vcCredentialTable[$_] -credentialDirectory $vamtCredentialDirectory 391 | } 392 | #Validate that all Tags and Categories required for the migration exist in all specified vCenters. 393 | if (!$vamtIgnoreTags) { 394 | Confirm-Tags -tagDetails $vamtTagDetails -viConnections $viConnections 395 | } else { 396 | Write-Log -severityLevel Warn -logMessage "Skipping tag state validation." 397 | } 398 | 399 | #ensure all VM attributes exist 400 | Confirm-CustomAttribute -attributeName $vamtVcAttrDetails.sourceVcAttribute -viConnections $viConnections 401 | Confirm-CustomAttribute -attributeName $vamtVcAttrDetails.sourceHostAttribute -viConnections $viConnections 402 | Confirm-CustomAttribute -attributeName $vamtVcAttrDetails.sourceRpAttribute -viConnections $viConnections 403 | Confirm-CustomAttribute -attributeName $vamtVcAttrDetails.sourceFolderAttribute -viConnections $viConnections 404 | Confirm-CustomAttribute -attributeName $vamtVcAttrDetails.sourceDsAttribute -viConnections $viConnections 405 | Confirm-CustomAttribute -attributeName $vamtVcAttrDetails.sourcePgAttribute -viConnections $viConnections 406 | Confirm-CustomAttribute -attributeName $vamtVcAttrDetails.migrationTsAttribute -viConnections $viConnections 407 | Confirm-CustomAttribute -attributeName $vamtVcAttrDetails.snapshotNameAttribute -viConnections $viConnections 408 | 409 | $validationParams = @{ 410 | inputs = $inputs 411 | inputHeaders = $inputHeaders 412 | tagDetails = $vamtTagDetails 413 | viConnections = $viConnections 414 | ignoreTags = $vamtIgnoreTags 415 | } 416 | if ($action -eq "migrate") { 417 | $migrationTargets = Confirm-MigrationTargets @validationParams -jobStates $jobStates -doNotRunStates $doNotRunStates -ignoreVmTools:$vamtIgnoreVmTools 418 | } elseif ($action -eq "rollback") { 419 | $migrationTargets = Confirm-RollbackTargets @validationParams -jobStates $jobStates -doNotRunStates $doNotRunStates -vCenterAttrs $vamtVcAttrDetails -ignoreVmTools:$vamtIgnoreVmTools 420 | } elseif ($action -eq "cleanup") { 421 | $cleanupTargets = Confirm-CleanupTargets @validationParams -snapshotAttrName $vamtVcAttrDetails.snapshotNameAttribute -readyState $readyToCleanup 422 | } 423 | 424 | #check change window 425 | if (![string]::IsNullOrEmpty($changeWindowStart)) { 426 | if ($action -ne "cleanup") { 427 | $changeWindow = $true 428 | $startTime = Get-Date -Date $changeWindowStart 429 | Write-Log -severityLevel Info -logMessage "Change window start time: $startTime" 430 | if ($changeWindowDuration -gt 0) { 431 | $endTime = $startTime.AddMinutes($changeWindowDuration) 432 | Write-Log -severityLevel Info -logMessage "Change window end time: $endTime" 433 | } else { 434 | Write-Log -severityLevel Info -logMessage "Change window does not have an end time." 435 | } 436 | } else { 437 | Write-Log -severityLevel Warn -logMessage "Change window specified but is not appropriate for action 'cleanup'. Ignoring change window." 438 | $changeWindow = $false 439 | } 440 | } else { 441 | $changeWindow = $false 442 | Write-Log -severityLevel Info -logMessage "No change window specified. Proceeding with script now." 443 | } 444 | 445 | if (!!$startTime) { 446 | if ($vamtScriptLaunchTime -lt $startTime) { 447 | #we are before the change window, schedule the run. 448 | if (!$WhatIf) { 449 | Write-Log -severityLevel Info -logMessage "Current time ($vamtScriptLaunchTime) is before the beginning of the specified change window start time ($startTime). Scheduling workflow to run at start of change window." 450 | New-ScheduledExecution -startTime $startTime -parameters $PSBoundParameters -scriptPath $vamtScriptPath -workingDirectory $vamtWorkingDirectory 451 | return 452 | } else { 453 | Write-Log -severityLevel Info -logMessage "Current time ($vamtScriptLaunchTime) is before the beginning of the specified change window start time ($startTime). Whatif enabled. Continuing with Script." 454 | } 455 | 456 | } elseif (Confirm-InChangeWindow -executeTime $vamtScriptLaunchTime -startWindow $startTime -endWindow $endTime) { 457 | # we are in the change window now 458 | Write-Log -severityLevel Info -logMessage "Current time ($vamtScriptLaunchTime) is within the specified change window. Proceeding with script now." 459 | } else { 460 | #we are after the change window. 461 | Write-Log -severityLevel Warn -logMessage "Current time ($vamtScriptLaunchTime) is after the end of the specified change window end time ($endTime). Nothing to do. Exiting." 462 | return 463 | } 464 | } 465 | 466 | #endregion 467 | ############################################################################################################################# 468 | 469 | ############################################################################################################################# 470 | # 471 | #region Main 472 | # 473 | ############################################################################################################################# 474 | 475 | if ($action -in @("migrate","rollback")) { 476 | #Migration & Rollback tasks 477 | Write-Log -severityLevel Info -logMessage "Pre-$action target states:`n$($migrationTargets | Format-Table | Out-String)" 478 | 479 | while(([array]($migrationTargets | Where-Object {$_.job_state -notin $doNotRunStates})).count -gt 0) { 480 | #check and update job progress 481 | $migrationTargets | Where-Object {$_.job_state -eq $jobInProgress} | ForEach-Object { 482 | $job = $_.job.ChildJobs 483 | #Job states: https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.jobstate 484 | if ($job.State -ne $jobInProgress) { 485 | if ($job.State -eq $jobComplete) { 486 | if ($job.Error -eq $null) { 487 | Write-Log -severityLevel Info "VM move job for '$($_.tgt_vm.Name)' is complete." 488 | $_.job_state = $jobComplete 489 | $_.tag_state = Get-VMStateBasedOnTag -vm $_.tgt_vm -viConn $viConnections -stateTagsCatName $vamtTagDetails.tagCatName -ignoreTags:$vamtIgnoreTags 490 | } else { 491 | Write-Log -severityLevel Warn "VM move job for '$($_.tgt_vm.Name)' completed with unhandled errors. Considering it '$jobCompleteWithErrors'. Errors:`n$(($job.Error | ForEach-Object { if (!!$_) {$_.ToString()}}) -join "`n")" 492 | $_.job_state = $jobCompleteWithErrors 493 | $_.tag_state = Set-VMStateTag -vm $_.tgt_vm -tagName $vamtTagDetails.completeWithErrorsTagName -stateTagsCatName $vamtTagDetails.tagCatName -WhatIf:(!!$WhatIf) -viConn $viConnections -ignoreTags:$vamtIgnoreTags 494 | } 495 | } elseif ($job.State -eq $jobFailed) { 496 | Write-Log -severityLevel Error "VM move job for '$($_.tgt_vm.Name)' failed with errors:`n$($job.Error.Exception.Message -join "`n")" 497 | Write-Log -severityLevel Error -logMessage "Failed Job Details:`n$($job | ConvertTo-Json -Depth 4)" -skipConsole -logFileNamePrefix $_.tgt_vm.Name -syslogServer '' 498 | if (!$job.Error -or ($job.Error.ToString() -match $retryErrors)) { 499 | if ($_.attempts -lt $jobRetries) { 500 | Write-Log -severityLevel Warn -logMessage "Error is eligible to be re-tried. Setting retry status to try again later for '$($_.tgt_vm.Name)'." 501 | $_.job_state = "failed_pendingRetry" 502 | } else { 503 | Write-Log -severityLevel Error -logMessage "All retry attempts for '$($_.tgt_vm.Name)' have been exhaused. Setting job state to '$jobFailed'." 504 | $_.job_state = $jobFailed 505 | $_.tag_state = Set-VMStateTag -vm $_.tgt_vm -tagName $vamtTagDetails.failedTagName -stateTagsCatName $vamtTagDetails.tagCatName -WhatIf:(!!$WhatIf) -viConn $viConnections -ignoreTags:$vamtIgnoreTags 506 | } 507 | } else { 508 | $_.job_state = $jobFailed 509 | $_.tag_state = Set-VMStateTag -vm $_.tgt_vm -tagName $vamtTagDetails.failedTagName -stateTagsCatName $vamtTagDetails.tagCatName -WhatIf:(!!$WhatIf) -viConn $viConnections -ignoreTags:$vamtIgnoreTags 510 | } 511 | } elseif ($job.State -eq "NotStarted") { 512 | Write-Log -severityLevel Info "VM move job for '$($_.tgt_vm.Name)' is still preparing to run." 513 | } else { 514 | Write-Log -severityLevel Error "VM move job for '$($_.tgt_vm.Name)' ended with unsupported state $($job.State). Considering this job failed." 515 | Write-Log -severityLevel Error -logMessage "Unkown Job State Details:`n$($job | ConvertTo-Json -Depth 4)" -skipConsole -logFileNamePrefix $_.tgt_vm.Name -syslogServer '' 516 | $_.job_state = $jobFailed 517 | $_.tag_state = Set-VMStateTag -vm $_.tgt_vm -tagName $vamtTagDetails.failedTagName -stateTagsCatName $vamtTagDetails.tagCatName -WhatIf:(!!$WhatIf) -viConn $viConnections -ignoreTags:$vamtIgnoreTags 518 | } 519 | } 520 | } 521 | if (([array]($migrationTargets | Where-Object {$_.job_state -notin $doNotRunStates})).count -le 0) { 522 | break 523 | } 524 | #check if changewindow is complete 525 | if ($changeWindow) { 526 | $stillWithinChangeWindow = Confirm-InChangeWindow -executeTime (Get-Date) -startWindow $startTime -endWindow $endTime 527 | if (!$stillWithinChangeWindow) { 528 | if ($parallelTaskCount -gt 0) { 529 | Write-Log -severityLevel Warn -logMessage "We are nolonger inside our change window. Turning the job throttle down to 0. All currently in progress tasks will be allowed to finish." 530 | $parallelTaskCount = 0 531 | $migrationTargets | Where-Object {$_.job_state -eq $jobReady} | ForEach-Object { 532 | $_.job = "Job not executed due to being past the end of the change window." 533 | $_.job_state = $jobNotRun 534 | } 535 | } 536 | if (([array]($migrationTargets | Where-Object {$_.job_state -eq $jobInProgress})).count -le 0) { 537 | break 538 | } 539 | } 540 | } 541 | 542 | #calculate how many slots for new jobs we have 543 | [int]$movesInProgress = ([array]($migrationTargets | Where-Object {$_.job_state -eq $jobInProgress})).count 544 | [int]$pendingMoves = ([array]($migrationTargets | Where-Object {$_.job_state -like "*pendingRetry" -or $_.job_state -eq $jobReady})).count 545 | $currentThrottle = [math]::Max(0, ($parallelTaskCount - $movesInProgress)) 546 | Write-Log -severityLevel Info -logMessage "There are currently $movesInProgress moves in progress and $pendingMoves moves waiting to start." 547 | 548 | [array]$batch = $migrationTargets | Sort-Object -Property attempts | Where-Object {$_.job_state -eq $jobReady} | Select-Object -First $currentThrottle 549 | if ($batch.count -lt $currentThrottle) { 550 | $batch += $migrationTargets | Sort-Object -Property attempts | Where-Object {$_.job_state -like "*pendingRetry"} | Select-Object -First ($currentThrottle-$batch.count) 551 | } 552 | #launch new jobs 553 | if ($batch.count -gt 0) { 554 | Write-Log -severityLevel Info -logMessage "New batch of moves: $($batch.tgt_vm.Name -join ", ")" 555 | $batch | ForEach-Object { 556 | $vm = $_.tgt_vm 557 | $srcViConn = $_.src_vcenter 558 | $tgtViConn = $_.tgt_vcenter 559 | 560 | [array]$activeTasks = Confirm-ActiveTasks -vm $vm -viConnection $srcViConn 561 | if ($null -ne $activeTasks) { 562 | if ($_.attempts -lt $jobRetries) { 563 | Write-Log -severityLevel Warn -logMessage "VM ($($vm.Name)) has $($activeTasks.count) active task(s) already. Setting retry status to try again later." 564 | $_.job_state = "busy_pendingRetry" 565 | $_.attempts++ 566 | } else { 567 | $_.job_state = $jobFailed 568 | $_.job = "Failed waiting for active tasks on VM to complete. Exhausted all $jobRetries retries." 569 | Write-Log -severityLevel Error -logMessage "VM ($($vm.Name)) failed with error: $($_.job)" 570 | $_.tag_state = Set-VMStateTag -vm $vm -tagName $vamtTagDetails.failedTagName -stateTagsCatName $vamtTagDetails.tagCatName -WhatIf:(!!$WhatIf) -viConn $viConnections -ignoreTags:$vamtIgnoreTags 571 | } 572 | return 573 | } 574 | 575 | $jobParams = @{ 576 | srcViConn = $srcViConn 577 | tgtViConn = $tgtViConn 578 | vm = $vm 579 | network = $_.tgt_network 580 | WhatIf = !!$WhatIf 581 | isRetry = ($_.attempts -gt 0) 582 | scriptVars = $scriptVars 583 | } 584 | if ($null -ne $_.tgt_folder) { 585 | $jobParams.vmfolder = $_.tgt_folder 586 | } 587 | 588 | if ($action -eq "migrate") { 589 | $_.job = Start-MigrateVMJob @jobParams -compute $_.tgt_compute -storage $_.tgt_storage 590 | } elseif ($action -eq "rollback") { 591 | $_.job = Start-RollbackVMJob @jobParams -vmhost $_.tgt_host -respool $_.tgt_respool -datastore $_.tgt_datastore -snapshot $_.tgt_snapshot 592 | } 593 | $_.job_state = $jobInProgress 594 | $_.attempts++ 595 | } 596 | } 597 | 598 | if (([array]($migrationTargets | Where-Object {$_.job_state -eq $jobInProgress})).count -gt 0) { 599 | Start-Sleep -Seconds $jobControllerRefreshInterval 600 | } 601 | } 602 | 603 | #Cleanup $null target folders for report. 604 | $migrationTargets | ForEach-Object {if ($null -eq $_.tgt_folder) {$_.tgt_folder = "N/A"}} 605 | Write-Log -severityLevel Info -logMessage "$action target states:`n$($migrationTargets | Format-Table | Out-String)" 606 | $finalObj = Save-Report -actionResult $migrationTargets -loggingDirectory $vamtLoggingDirectory 607 | } elseif ($action -eq "cleanup") { 608 | Write-Log -severityLevel Info -logMessage "Pre-$action target states:`n$($cleanupTargets | Format-Table | Out-String)" 609 | #Cleanup task 610 | while(([array]($cleanupTargets | Where-Object {$_.job_state -notin $cleanupCompleteStates})).count -gt 0) { 611 | #check and update job progress 612 | $cleanupTargets | Where-Object {$_.job_state -eq $jobInProgress} | ForEach-Object { 613 | $job = $_.job.ChildJobs 614 | #Job states: https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.jobstate 615 | if ($job.State -ne $jobInProgress) { 616 | if ($job.State -eq $jobComplete) { 617 | if ($job.Error -eq $null) { 618 | Write-Log -severityLevel Info "VM cleanup job for '$($_.clean_vm.Name)' is complete." 619 | $_.job_state = $jobComplete 620 | $_.tag_state = Get-VMStateBasedOnTag -vm $_.clean_vm -viConn $viConnections -stateTagsCatName $vamtTagDetails.tagCatName -ignoreTags:$vamtIgnoreTags 621 | } else { 622 | Write-Log -severityLevel Warn "VM cleanup job for '$($_.clean_vm.Name)' completed with unhandled errors. Considering it complete with errors." 623 | $_.job_state = $jobCompleteWithErrors 624 | $_.tag_state = Get-VMStateBasedOnTag -vm $_.clean_vm -viConn $viConnections -stateTagsCatName $vamtTagDetails.tagCatName -ignoreTags:$vamtIgnoreTags 625 | } 626 | } elseif ($job.State -eq $jobFailed) { 627 | Write-Log -severityLevel Error "VM cleanup job for '$($_.clean_vm.Name)' failed with errors:`n$($job.Error.Exception.Message -join "`n")" 628 | Write-Log -severityLevel Error -logMessage "Failed Job Details:`n$($job | ConvertTo-Json -Depth 4)" -skipConsole -logFileNamePrefix $_.tgt_vm.Name -syslogServer '' 629 | if (!$job.Error -or ($job.Error.ToString() -match $retryErrors)) { 630 | if ($_.attempts -lt $jobRetries) { 631 | Write-Log -severityLevel Warn -logMessage "Error is eligible to be re-tried. Setting retry status to try again later for '$($_.clean_vm.Name)'." 632 | $_.job_state = "failed_pendingRetry" 633 | } else { 634 | Write-Log -severityLevel Error -logMessage "All retry attempts for '$($_.clean_vm.Name)' have been exhaused. Setting job state to '$jobFailed'." 635 | $_.job_state = $jobFailed 636 | $_.tag_state = Get-VMStateBasedOnTag -vm $_.clean_vm -viConn $viConnections -stateTagsCatName $vamtTagDetails.tagCatName -ignoreTags:$vamtIgnoreTags 637 | } 638 | } else { 639 | $_.job_state = $jobFailed 640 | $_.tag_state = Get-VMStateBasedOnTag -vm $_.clean_vm -viConn $viConnections -stateTagsCatName $vamtTagDetails.tagCatName -ignoreTags:$vamtIgnoreTags 641 | } 642 | } elseif ($job.State -eq "NotStarted") { 643 | Write-Log -severityLevel Info "VM cleanup job for '$($_.clean_vm.Name)' is still preparing to run." 644 | } else { 645 | Write-Log -severityLevel Error "VM cleanup job for '$($_.clean_vm.Name)' ended with unsupported state $($job.State). Considering this job failed." 646 | Write-Log -severityLevel Error -logMessage "Unkown Job State Details:`n$($job | ConvertTo-Json -Depth 4)" -skipConsole -logFileNamePrefix $_.clean_vm.Name -syslogServer '' 647 | $_.job_state = $jobFailed 648 | $_.tag_state = Get-VMStateBasedOnTag -vm $_.clean_vm -viConn $viConnections -stateTagsCatName $vamtTagDetails.tagCatName -ignoreTags:$vamtIgnoreTags 649 | } 650 | } 651 | } 652 | if (([array]($cleanupTargets | Where-Object {$_.job_state -notin $cleanupCompleteStates})).count -le 0) { 653 | break 654 | } 655 | 656 | #calculate how many slots for new jobs we have 657 | [int]$cleansInProgress = ([array]($cleanupTargets | Where-Object {$_.job_state -eq $jobInProgress})).count 658 | [int]$pendingCleans = ([array]($cleanupTargets | Where-Object {$_.job_state -like "*pendingRetry" -or $_.job_state -eq $jobReady})).count 659 | $currentThrottle = [math]::Max(0, ($parallelTaskCount - $cleansInProgress)) 660 | Write-Log -severityLevel Info -logMessage "There are currently $cleansInProgress cleanups in progress and $pendingCleans cleanups waiting to start." 661 | 662 | [array]$batch = $cleanupTargets | Where-Object {$_.job_state -eq $readyToCleanup} | Select-Object -First $currentThrottle 663 | #launch new jobs 664 | if ($batch.count -gt 0) { 665 | Write-Log -severityLevel Info -logMessage "New batch of cleanups: $($batch.clean_vm.Name -join ", ")" 666 | $batch | ForEach-Object { 667 | $vm = $_.clean_vm 668 | $viConn = $_.clean_vc 669 | 670 | [array]$activeTasks = Confirm-ActiveTasks -vm $vm -viConnection $viConn 671 | if ($null -ne $activeTasks) { 672 | if ($_.attempts -lt $jobRetries) { 673 | Write-Log -severityLevel Warn -logMessage "VM ($($vm.Name)) has $($activeTasks.count) active task(s) already. Setting retry status to try again later." 674 | $_.job_state = "busy_pendingRetry" 675 | $_.attempts++ 676 | } else { 677 | $_.job_state = $jobFailed 678 | $_.job = "Failed waiting for active tasks on VM to complete. Exhausted all $jobRetries retries." 679 | Write-Log -severityLevel Error -logMessage "VM ($($vm.Name)) failed with error: $($_.job)" 680 | $_.tag_state = Get-VMStateBasedOnTag -vm $vm -viConn $viConn -stateTagsCatName $vamtTagDetails.tagCatName -ignoreTags:$vamtIgnoreTags 681 | } 682 | return 683 | } 684 | $_.job = Start-CleanupVMJob -viConn $viConn -vm $vm -snapshot $_.clean_snapshot -scriptVars $scriptVars -WhatIf:(!!$WhatIf) 685 | $_.job_state = $jobInProgress 686 | $_.attempts++ 687 | } 688 | } 689 | 690 | if (([array]($cleanupTargets | Where-Object {$_.job_state -eq $jobInProgress})).count -gt 0) { 691 | Start-Sleep -Seconds $jobControllerRefreshInterval 692 | } 693 | } 694 | 695 | Write-Log -severityLevel Info -logMessage "Post-$action VM states:`n$($cleanupTargets | Format-Table | Out-String)" 696 | $finalObj = Save-Report -actionResult $cleanupTargets -loggingDirectory $vamtLoggingDirectory 697 | } else { 698 | #unhandled action fail 699 | $errorMessage = "Unknown action '$action' received. Allowable options are 'migrate', 'rollback', 'cleanup'. Exiting." 700 | Write-Log -severityLevel Error -logMessage $errorMessage -skipConsole 701 | throw $errorMessage 702 | } 703 | 704 | $currentTime = Get-Date 705 | $finalMessage = "Script run summary:`n`tScript start: '$vamtScriptLaunchTime'" 706 | $finalMessage += "`n`tScript runtime: $([math]::Round(($currentTime - $vamtScriptLaunchTime).TotalMinutes)) minutes" 707 | $finalMessage += "`n`tScript completion: '$currentTime'" 708 | $finalMessage += "`n`tTotal VM targets in migration run: $($finalObj.Count)" 709 | $vmMultiAttemptCount = ($finalObj | Where-Object { $_.attempts -gt 1}).Count 710 | $finalMessage += "`n`tTotal VM jobs with retry attempts: $vmMultiAttemptCount" 711 | $notAttemptedCount = 0 712 | $finalObj.job_state | Select-Object -Unique | ForEach-Object { 713 | $state = $_ 714 | $jobs = $finalObj | Where-Object {$_.job_state -eq $state} 715 | if ($state -notin $jobStates.Values) { 716 | $finalMessage += "`n`tVM migration jobs with final status '$state': $($jobs.count)" 717 | } else { 718 | $notAttemptedCount += $jobs.count 719 | } 720 | } 721 | if ($notAttemptedCount -gt 0) { 722 | $finalMessage += "`n`tVM migration jobs Not Attempted: $notAttemptedCount" 723 | } 724 | 725 | 726 | Write-Log -severityLevel Info -logMessage $finalMessage 727 | Write-Log -severityLevel Info -logMessage "Final report:`n$($finalObj | Format-Table | Out-String)" 728 | 729 | if (![string]::IsNullOrWhiteSpace($smtpServer)) { 730 | try { 731 | $reportParameters = @{ 732 | launchTime = $vamtScriptLaunchTime 733 | action = $vamtAction 734 | smtpServer = $vamtSmtpServer 735 | smtpPort = $vamtSmtpPort 736 | finalObject = $finalObj 737 | message = $finalMessage 738 | toEmail = $toEmail 739 | fromEmail = $fromEmail 740 | useSsl = $smtpUseSsl 741 | } 742 | if ($authenticatedEmail) { 743 | $reportParameters.secureMailCred = $emailCredential 744 | } 745 | Write-Log -severityLevel Info -logMessage "Preparing to send final status email." 746 | Send-Report @reportParameters 747 | } catch { 748 | Write-Log -severityLevel Error -logMessage "Failed to send final email message with following exception:`n$($_.toString())" 749 | } 750 | } 751 | 752 | try { Disconnect-VIServer * -Confirm:$false } catch {} 753 | Stop-Transcript 754 | #endregion 755 | ############################################################################################################################# -------------------------------------------------------------------------------- /example/toMigrate.csv: -------------------------------------------------------------------------------- 1 | vmname,target_vc,target_hostpoolcluster,target_portgroup,target_datastore,target_folder 2 | candidatevm1,vc1.corp.local,NewCluster,VLAN-16,DatastoreCluster,Migrations 3 | candidatevm4,vc1.corp.local,OtherCluster,VLAN-10,NFS01,Migrations 4 | candidatevm6,vc1.corp.local,esx01.corp.local,VM Network,NFS01,Corp/Migrations 5 | candidatevm2,vc1.corp.local,NewCluster,VLAN-16,NFS02,Migrations 6 | candidatevm3,vc1.corp.local,resourcePool1,VLAN-16,NFS02,Discovered virtual machine 7 | candidatevm5,vc1.corp.local,OtherCluster,LS-10.1.102.X/24,NFS02, -------------------------------------------------------------------------------- /example/toMigrate.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "vmname": "candidatevm1", 4 | "target_vc": "vc1.corp.local", 5 | "target_hostpoolcluster": "NewCluster", 6 | "target_portgroup": [ "VLAN-16", "VLAN-10" ], 7 | "target_datastore": [ "DatastoreCluster", "DatastoreCluster" ], 8 | "target_folder": "Migrations" 9 | }, 10 | { 11 | "vmname": "candidatevm2", 12 | "target_vc": "vc1.corp.local", 13 | "target_hostpoolcluster": "NewCluster", 14 | "target_portgroup": [ "VLAN-16", "VLAN-10" ], 15 | "target_datastore": [ "NFS02", "NFS01" ], 16 | "target_folder": "Corp/Migrations" 17 | }, 18 | { 19 | "vmname": "candidatevm3", 20 | "target_vc": "vc1.corp.local", 21 | "target_hostpoolcluster": "resourcePool1", 22 | "target_portgroup": [ "VLAN-16", "VLAN-10" ], 23 | "target_datastore": [ "NFS02" ], 24 | "target_folder": "Corp/SomeFolder/Migrations" 25 | }, 26 | { 27 | "vmname": "candidatevm4", 28 | "target_vc": "vc1.corp.local", 29 | "target_hostpoolcluster": "OtherCluster", 30 | "target_portgroup": [ "VLAN-10", "VLAN-16" ], 31 | "target_datastore": [ "NFS01" ], 32 | "target_folder": "Migrations" 33 | }, 34 | { 35 | "vmname": "candidatevm5", 36 | "target_vc": "vc1.corp.local", 37 | "target_hostpoolcluster": "OtherCluster", 38 | "target_portgroup": [ "LS-10.1.102.X/24", "VLAN-10" ], 39 | "target_datastore": [ "NFS02" ], 40 | "target_folder": "Migrations" 41 | }, 42 | { 43 | "vmname": "candidatevm6", 44 | "target_vc": "vc1.corp.local", 45 | "target_hostpoolcluster": "esx01.corp.local", 46 | "target_portgroup": [ "VM Network" ], 47 | "target_datastore": [ "NFS01" ], 48 | "target_folder": "" 49 | } 50 | ] -------------------------------------------------------------------------------- /wiki/Design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | This guide is intended to discuss the code in detail to assist future modifications without the support of the original 3 | authors. The sections below are design to give a clear picture of exactly what the code will do and provide insight into 4 | the rational of the design. 5 | 6 | ## Overview 7 | In order to maintain state and support rolling back after a VM has been migrated, the tool has three user selectable tasks: migration, state clean up, and rollback. 8 | - **Migration** - Migrate a set of machines 9 | - **Cleanup** - Cleanup the state on machines, either after a successful complete migration or from a failure that caused manual cleanup. 10 | - **Rollback** - Rollback machines back to their original location in the event of a post migration validation failure (see limitations section). 11 | 12 | ## Philosophy 13 | The following list of statements define the guidelines used to develop the tool and resulting code. 14 | 15 | - The tool should consist of support documentation and only one file to execute. 16 | - Minimal libraries are required to execute the tool. 17 | - Operate on the VMs as safely as possible while also maintaining the UUID. 18 | - Best effort to provide performance without being overly complex. 19 | - Maintain the state of the migrated VM with vSphere. 20 | - Utilize a common and easy input file format. 21 | 22 | ## Conceptual Model 23 | The conceptual model below shows the makeup of the "layers" of software. The tool will enter a dispatcher function that will make decisions about which function to call based on the requested task. Each of those tasks start at a controller who has the job to iterate over the VM list and throttle the execution. Inside each controller is a function to handle the task on an individual VM. 24 | 25 | ![Conceptual Model](./images/VAMT-Scripting_Tool_Process-conceptual_model.jpg) 26 | 27 | ## Logic Flow Diagrams 28 | Below are the logic flow diagrams for each of the functions defined in the conceptual model. 29 | 30 | ### Dispatcher Flow 31 | The dispatcher is the entry point into the tool; it makes decisions based on what task is requested. 32 | 33 | ![Dispatcher Flow](./images/VAMT-Scripting_Tool_Process-main.jpg) 34 | 35 | ### Migration Controller 36 | The migration controller parses the VM list then manages throttling the number of individual VM tasks being executed at once. 37 | 38 | ![Migration Controller Flow](./images/VAMT-Scripting_Tool_Process-migration_controller_process.jpg) 39 | 40 | ### Migrate 41 | The migration process defines the logic for migrating an individual VM. 42 | 43 | ![Migrate Flow](./images/VAMT-Scripting_Tool_Process-migrate_process.jpg) 44 | 45 | ### Rollback Controller 46 | The rollback controller parses the VM list then manages throttling the number of individual VM tasks being executed at once. 47 | 48 | ![Rollback Controller Flow](./images/VAMT-Scripting_Tool_Process-rollback_controller.jpg) 49 | 50 | ### Rollback 51 | The rollback process defines the logic for rolling back an individual VM. 52 | 53 | ![Rollback Flow](./images/VAMT-Scripting_Tool_Process-rollback_process.jpg) 54 | 55 | ### Cleanup Controller 56 | The cleanup controller parses the VM list then manages throttling the number of individual VM tasks being executed at once. 57 | 58 | ![Rollback Controller Flow](./images/VAMT-Scripting_Tool_Process-cleanup_controller.jpg) 59 | 60 | ### Cleanup 61 | The cleanup process defines the logic for cleaning up an individual VM. 62 | 63 | ![Rollback Flow](./images/VAMT-Scripting_Tool_Process-cleanup_process.jpg) 64 | -------------------------------------------------------------------------------- /wiki/QuickStartGuide.md: -------------------------------------------------------------------------------- 1 | # VMware Architecture Migration Tool (VAMT) 2 | # Quick Start Guide (with examples) 3 | --- 4 | The VMware Architecture Migration Tool (VAMT) is a PowerShell script that uses VMware PowerCLI to enable moving a VM from one hardware architecture (for example, Intel) to a different hardware architecture (for example, AMD). 5 | 6 | There are some constraints and guidelines for this VM movement that are outlined in the full [Script User's Guide](./Script_Usage.md). The User's Guide covers more of the functional details for the runtime usage of the script and should be referred to for more thorough documentation. This Quick Start guide is intended to be a cheat sheet showing an example of the script usage that was captured during initial testing. 7 | 8 | # Prerequisites 9 | There are several prerequisites that need to be completed before the VAMT script can executed. Some of these prerequisites are in the vCenter settings while others are environmental ecosystem items. For more detailed documentation around the prerequisites, see the [Script Prerequisites](./Script_Prerequisites.md). A basic list of these are shown below. 10 | 11 | - Host system capable of executing Windows PowerShell scripts as administrator 12 | - Host system VMware PowerCLI installed in PowerShell (see one of the following links) 13 | [Installing VMware PowerCLI](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.esxi.install.doc/GUID-F02D0C2D-B226-4908-9E5C-2E783D41FE2D.html) or [PowerCLI Installation Guide](https://developer.vmware.com/powercli/installation-guide) 14 | - Administrator credentials on instance of the vcenter holding the clusters where the VMs live that are to be migrated 15 | - Host system must have access to the vcenter where the VMs live 16 | - Access to VAMT source repo: 17 | > Public repo link: [VMware Architecture Migration Tool](https://github.com/vmware-samples/vmware-architecture-migration-tool) 18 | - If Distributed Resource Scheduler (DRS) is part of your vcenter, then it must be enabled on the clusters being migrated from and to 19 | > 1) Navigate to cluster 20 | [Link to Enabling VMware DRS from vSphere documentation](https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.mscs.doc/GUID-C228FA54-F621-45DA-8D62-AD8C118C89C0.html) 21 | Sample screen shots: 22 | ![Enabling DRS in vSphere example ("blue cluster")](./images/VAMT-EnablingDRS_1.jpg) 23 | 24 | > 2) Edit cluster to enable DRS for compute resources 25 | **NOTE: If using Datastore clusters, you must also enable Storage DRS on those as well if using the Datastore cluster as an input.** 26 | 27 | 28 | ![Enabling DRS in vSphere](./images/VAMT-EnablingDRS_2.jpg) 29 | - For email notifications to work see the example configuration below. The credentials need to be whatever is needed for SMTP authentication, such as: 30 | - username/password 31 | - IAM token 32 | - Security certificate/key 33 | ***Example @options setup:*** 34 | ``` 35 | [string]$userName = 'username@email.domain' 36 | [string]$userPassword = 'password' 37 | [securestring]$secStringPassword = ConvertTo-SecureString $userPassword -AsPlainText -Force 38 | [pscredential]$credObject = New-Object System.Management.Automation.PSCredential($userName, $secStringPassword) 39 | $options = @{ 40 | . 41 | . 42 | toEmail = "tousername@email.domain" 43 | fromEmail = "fromusername@email.domain" 44 | smtpServer = "a.b.c.d:port" 45 | secureMailCred = $credObject 46 | smtpUseSsl = $true 47 | . 48 | . 49 | } 50 | .\VMwareArchitectureMigrationTool.ps1 @options 51 | ``` 52 | - For syslog to work: 53 | - Need to have a syslog server set up and accessible from the execution host 54 | - The options hash table argument needs to point to that valid IP address 55 | ***Example @options setup:*** 56 | ``` 57 | $options = @{ 58 | . 59 | . 60 | syslogHost = "a.b.c.d:port" 61 | . 62 | . 63 | } 64 | .\VMwareArchitectureMigrationTool.ps1 @options 65 | ``` 66 | # Pre-migration notes 67 | NOTES: 68 | - Much of this setup can be automated once the user is familiar with the environment. There are example PowerShell/PowerCLI scripts in the vamt_dir repo that can be used for enabling this automation. 69 | 70 | - The first time the script is run in a PowerShell session you may see warnings that look like the following. These are from PowerCLI and can be safely ignored.
71 | *Example warnings that may be seen:* 72 | ``` 73 | WARNING: The 'Version' property of VirtualMachine type is deprecated. Use the 'HardwareVersion' property instead. 74 | WARNING: The 'DrsMode' property of Cluster type is deprecated. Use the 'DrsAutomationLevel' property instead. 75 | WARNING: The 'Accessible' property of Datastore type is deprecated. Use the 'State' property instead. 76 | WARNING: The 'State' property of VMHost type is deprecated. Use the 'ConnectionState' property instead. 77 | WARNING: PowerCLI scripts should not use the 'DatastoreIdList' property of VMHost type. The property will be removed in a future release. 78 | WARNING: The 'IsChildTypeVm' property of the Folder type is deprecated. Use the Type property instead. 79 | WARNING: The 'IsChildTypeComputeResource' property of the Folder type is deprecated. Use the Type property instead. 80 | WARNING: The 'IsChildTypeDatacenter' property of the Folder type is deprecated. Use the Type property instead. 81 | WARNING: The 'IsChildTypeDatastore' property of the Folder type is deprecated. Use the Type property instead. 82 | WARNING: The 'Quiesced' property of Snapshot type is deprecated and will be removed in a future release. 83 | WARNING: The 'Parent' property of Snapshot type is deprecated. Use the 'ParentSnapshot' property instead. 84 | ``` 85 | 86 | # Migration 87 | 88 | ## 1) Pull vamt_dir git repository down to the execution host 89 | ***Example repo clone:*** 90 | ``` 91 | user@MYSYSTEM:/vmtest$ git clone git@github.com:vmware-samples/vmware-architecture-migration-tool.git 92 | Cloning into 'vmware-architecture-migration-tool'... 93 | remote: Enumerating objects: 260, done. 94 | remote: Counting objects: 100% (89/89), done. 95 | remote: Compressing objects: 100% (68/68), done. 96 | remote: Total 260 (delta 45), reused 50 (delta 21), pack-reused 171 97 | Receiving objects: 100% (260/260), 2.74 MiB | 8.14 MiB/s, done. 98 | Resolving deltas: 100% (128/128), done. 99 | ``` 100 | 101 | ## 2) Set up desired one-time session settings for migration and interaction with VMware PowerCLI 102 | ``` 103 | Set-PowerCLIConfiguration -Scope User -ParticipateInCeip $true -InvalidCertificateAction Ignore 104 | Set-PowerCLIConfiguration -DisplayDeprecationWarnings:$false -Scope User 105 | ``` 106 | 107 | ## 3) Add required single cardinality VM tags in vSphere category VAMT. These tags are used to drive the migration and/or rollback process. 108 | 109 | **NOTE: The VAMT category and required tags can also be programmatically set up using PowerCLI.** 110 | 111 | > 3.1) Get most recent list of tags required for the migration process from the script source: 112 | [Link to list of migration tags in source](../VMwareArchitectureMigrationTool.ps1#L152) 113 | ``` 114 | tagCatName = "VAMT" 115 | readyTagName = "readyToMigrate" 116 | inProgressTagName = "inProgress" 117 | completeTagName = "complete" 118 | completeWithErrorsTagName = "completeWithErrors" 119 | failedTagName = "failed" 120 | readyToRollbackTagName = "readyToRollback" 121 | rollbackTagName = "rolledBack" 122 | ``` 123 | 124 | > 3.2) Create the VAMT tag category, using the "Tags & Custom Attributes" window off the main "Menu" pulldown 125 | ![Navigate to Tags Window](./images/VAMT-SettingUpTags_1.jpg) 126 | ![Open Tag Category Menu](./images/VAMT-SettingUpTags_2.jpg) 127 | ![Create VAMT Tag Category](./images/VAMT-SettingUpTags_3.jpg) 128 | This category must be single cardinality (i.e. the "Tags Per Object" needs to be set to "One Tag"), so that only 1 tag of that category can be applied to any given VM. While all of the "Associable Object Types" for that tag are checked, can probably get by with either "All Objects" or just "Virtual Machine".
129 | Once this tag category is created as shown above, save this for use with the next step of setting up the tags. 130 | 131 | > 3.3) Create the tags shown above in the VAMT tag category 132 | ![Create VAMT Tag Category](./images/VAMT-SettingUpTags_4.jpg) 133 | 134 | ## 4) Create list of VMs to migrate in .csv format 135 | 136 | [Example CSV file](../example/toMigrate.csv) 137 | 138 | For this captured example runthrough, the following set of values was used in a file called "toMigrate.csv", much like the one shown in the link above: 139 | ``` 140 | vmname,target_hostpoolcluster,target_portgroup,target_datastore 141 | Win2012r2-1,green,VLAN819-Green,Green 142 | Win2012r2-2,green,VLAN819-Green,Green 143 | Win2012r2-3,green,VLAN819-Green,Green 144 | Win2012r2-4,green,VLAN819-Green,Green 145 | Win2012r2-5,green,VLAN819-Green,Green 146 | ``` 147 | 148 | ## 5) Set up helper for for script execution 149 | The TestMigrate.ps1 PowerShell script example below shows one way that the options hash table can be customized and used to invoke the migration script. You can also embed the hash table setup in to other scripts or calls from your own tooling, set these variables up as part of a separate script, or you can pass the various options in as list of command line arguments to the migration script itself. This is the approach that was executed for collecting the screenshots throughout the following examples, however this is just one approach. 150 | 151 | *TestMigrate.ps1* 152 | ``` 153 | [string]$userName = 'username@email.domain' 154 | [string]$userPassword = 'password' 155 | [securestring]$secStringPassword = ConvertTo-SecureString $userPassword -AsPlainText -Force 156 | [pscredential]$credObject = New-Object System.Management.Automation.PSCredential($userName, $secStringPassword) 157 | 158 | $options = @{ 159 | action = "migrate" 160 | vcenters = "a.b.c.d" 161 | inputFilePath = ".\example\toMigrate.csv" 162 | changeWindowStart = "7/11/2022 13:16:58" 163 | changeWindowDuration = 0 164 | parallelTaskCount = 5 165 | syslogHost = "a.b.c.d:port" 166 | toEmail = "tousername@email.domain" 167 | fromEmail = "fromusername@email.domain" 168 | smtpServer = "a.b.c.d:port" 169 | secureMailCred = $credObject 170 | smtpUseSsl = $true 171 | Debug = $false 172 | debugLogging = $true 173 | } 174 | .\VMwareArchitectureMigrationTool.ps1 @options 175 | ``` 176 | 177 | This helper script can be run from anywhere [VMwareArchitectureMigrationTool.ps1](../VMwareArchitectureMigrationTool.ps1), [VAMT.psm1](../VAMT.psm1), and the migration targets inputs .csv file ([Example CSV file](../example/toMigrate.csv)) exist. A convenient location to execute the script is from the root of the repo after cloning it down from git. 178 | 179 | Example: 180 | ``` 181 | PS C:\Users\admin\Test\vamt_dir> dir 182 | Directory: C:\Users\admin\Test\vamt_dir 183 | LastWriteTime Length Name 184 | ------------- ------ ---- 185 | 7/14/2022 11:03 AM . example 186 | 7/17/2022 6:22 PM . vamt_runlogs 187 | 7/14/2022 2:53 PM . wiki 188 | 7/6/2022 4:10 PM 15 .gitignore 189 | 7/11/2022 12:41 PM 528 README.md 190 | 7/17/2022 7:03 PM 260 VAMT.psm1 191 | 7/15/2022 3:23 PM 103801 VMwareArchitectureMigrationTool.ps1 192 | ``` 193 | 194 | ## 6) Clean up any existing VAMT tags and add the readyToMigrate VAMT tag to all VMs to be migrated 195 | 196 | The next thing to do is to set the tags up to be ready for migration in vcenter. As in the other examples in this document, this can be automated using an approach outlined in the example script shown above, however this cheat sheet shows how it is done in the vSphere UI. 197 | 198 | > 6.1) First navigate to the list of VMs you want to migrate. We found it convenient during initial testing to group these into folders for easy selection. 199 | ![List of VMs in folder](./images/VAMT-ExampleVMList.jpg) 200 | 201 | > 6.2) Once you have the list of VMs you want to migrate from one cluster to the other, you need to remove any existing VAMT tags from those VMs. Since that VAMT tag category is set up with single cardinality only 1 tag can exist per VM from that category, so this makes sure they are all removed before doing the migration. 202 | ![Remove all existing VAMT tags](./images/VAMT-ExampleVMList_RemoveTags_1.jpg) 203 | 204 | > 6.3) Now add the readyToMigrate VAMT tag to the list of VMs 205 | ![Add readyToMigrate](./images/VAMT-ExampleVMList_AssignTags_1.jpg) 206 | ![Add readyToMigrate](./images/VAMT-ExampleVMList_AssignTags_2.jpg) 207 | 208 | To double check that the tag is assigned properly, you can look at the VM summary 209 | ![Add readyToMigrate](./images/VAMT-ExampleVMList_AssignTags_3.jpg) 210 | 211 | ## 7) Execute migration 212 | In this example, the 5 VMs are going to be migrated from the blue cluster shown below to the green cluster. In this test setup, the blue cluster are Intel hosts, while the green cluster are AMD hosts. 213 | ![Pre-migration in vSphere](./images/VAMT-MigrateVMs_1.jpg) 214 | 215 | > 7.1) Open up a PowerShell window on the execution host 216 | 217 | As described in the prerequisites and setup, PowerCLI must be installed and the execution host needs network access to the vcenter as well as administrator credentials. 218 | 219 | ![Open PowerShell / PowerCLI window](./images/VAMT-MigrateVMs_2.jpg) 220 | 221 | > 7.2) Execute the migration using the helper script 222 | 223 | If all is set up properly, the script will then shut down the VMs and begin migrating them to the other cluster architecture. 224 | 225 | ![Execute migration](./images/VAMT-MigrateVMs_3.jpg) 226 | 227 | > 7.3) Check migration is in progress in vcenter between the architectures (Intel to AMD, in this case) 228 | 229 | As the migration executes, you should see the VM tasks running in the vsphere task window 230 | 231 | ![Check migration is running](./images/VAMT-MigrateVMs_4.jpg) 232 | 233 | > 7.4) Check migration status once complete 234 | 235 | Once the migration is complete, you will get a status summary about the migration. Any errors encountered along the way are logged as well. 236 | 237 | ``` 238 | [Info] 07/18/2022 10:51:45 - There are currently 5 moves in progress and 0 moves waiting to start. 239 | [Info] 07/18/2022 10:52:00 - VM move job for 'Win2012r2-4' is complete. 240 | [Info] 07/18/2022 10:52:00 - There are currently 4 moves in progress and 0 moves waiting to start. 241 | [Info] 07/18/2022 10:52:15 - There are currently 4 moves in progress and 0 moves waiting to start. 242 | [Info] 07/18/2022 10:52:30 - VM move job for 'Win2012r2-2' is complete. 243 | [Info] 07/18/2022 10:52:30 - VM move job for 'Win2012r2-5' is complete. 244 | [Info] 07/18/2022 10:52:30 - There are currently 2 moves in progress and 0 moves waiting to start. 245 | [Info] 07/18/2022 10:52:45 - VM move job for 'Win2012r2-1' is complete. 246 | [Info] 07/18/2022 10:52:45 - VM move job for 'Win2012r2-3' is complete. 247 | [Info] 07/18/2022 10:52:46 - migrate target states: 248 | 249 | tgt_vm tgt_compute tgt_network tgt_storage tag_state job_state job attempts 250 | ------ ----------- ----------- ----------- --------- --------- --- -------- 251 | Win2012r2-1 green VLAN819-Green Green complete Completed System.Management.Automation.PSRemotingJob 1 252 | Win2012r2-2 green VLAN819-Green Green complete Completed System.Management.Automation.PSRemotingJob 1 253 | Win2012r2-3 green VLAN819-Green Green complete Completed System.Management.Automation.PSRemotingJob 1 254 | Win2012r2-4 green VLAN819-Green Green complete Completed System.Management.Automation.PSRemotingJob 1 255 | Win2012r2-5 green VLAN819-Green Green complete Completed System.Management.Automation.PSRemotingJob 1 256 | 257 | [Info] 07/18/2022 10:52:46 - Script run summary: 258 | Script start: '07/18/2022 10:44:22' 259 | Script runtime: 8 minutes 260 | Script completion: '07/18/2022 10:52:46' 261 | [Info] 07/18/2022 10:52:46 - Final report: 262 | 263 | tgt_compute tgt_network job_result tgt_storage tag_state job_state attempts tgt_vm 264 | ----------- ----------- ---------- ----------- --------- --------- -------- ------ 265 | green VLAN819-Green Successfully moved VM 'Win2012r2-1'. Green complete Completed 1 Win2012r2-1 266 | green VLAN819-Green Successfully moved VM 'Win2012r2-2'. Green complete Completed 1 Win2012r2-2 267 | green VLAN819-Green Successfully moved VM 'Win2012r2-3'. Green complete Completed 1 Win2012r2-3 268 | green VLAN819-Green Successfully moved VM 'Win2012r2-4'. Green complete Completed 1 Win2012r2-4 269 | green VLAN819-Green Successfully moved VM 'Win2012r2-5'. Green complete Completed 1 Win2012r2-5 270 | 271 | [Info] 07/18/2022 10:52:46 - Preparing to send final status email. 272 | Transcript stopped, output file is C:\Users\admin\Test\vamt_dir\vamt_runlogs\20220718-104422\transcript-20220718T1044221610.log 273 | PS C:\Users\admin\Test\vamt_dir> 274 | ``` 275 | 276 | You can double check to make sure that the migrated VMs from the blue Intel cluster ended up on the correct green AMD cluster: 277 | ![Verify VMs on new cluster now](./images/VAMT-MigrateVMs_5.jpg) 278 | 279 | And as an additional validation, you can examine the final state of each VM. You can check each one to see that the VAMT tag is showing complete, that the VM is now moved to the AMD green cluster, and that the VM is powered back up on the green network with the green datastore in this example. 280 | 281 | ![Verify state of VMs](./images/VAMT-MigrateVMs_6.jpg) 282 | 283 | # Rollback 284 | VMs can be rolled back to the original cluster at any point after a migration operation is complete. Rollback basically can be thought of as a reverse migration, going from the target cluster that the VM was migrated to back to the original cluster it started in. 285 | 286 | Once a migration has been completed, there is information stored in the custom attributes along with a snapshot that was taken for that VM: 287 | ![Rollback snapshot](./images/VAMT-RollbackVMs_1.jpg) 288 | This is the information that is then used to drive the rollback. 289 | 290 | ## 1) Change operation action in options to rollback 291 | To execute a rollback in it's simplest form, just change the operation action in the options from "migrate" to "rollback": 292 | ``` 293 | $options = @{ 294 | action = "rollback" 295 | . 296 | . 297 | } 298 | ``` 299 | ## 2) Verify the VMs you want to rollback in the input .csv file 300 | Note that while the input argument file will contain the list of VMs to roll back in the same way as with migration, only the VM name itself is actually used by the script from the migration .csv file during the rollback. All of the other information needed for the rollback comes from the custom attributes and snapshot data shown above. The other fields for cluster, network, and datastore can safely be left in there, as shown in the example, they just won't be used during the rollback. Instead, the information that was stored as part of the snapshot and custom attributes when the migration was done is used for the cluster, network, and datastore. 301 | ``` 302 | vmname,target_hostpoolcluster,target_portgroup,target_datastore 303 | Win2012r2-1,blue,VLAN819-Blue,Blue 304 | Win2012r2-2,blue,VLAN819-Blue,Blue 305 | Win2012r2-3,blue,VLAN819-Blue,Blue 306 | Win2012r2-4,blue,VLAN819-Blue,Blue 307 | Win2012r2-5,blue,VLAN819-Blue,Blue 308 | ``` 309 | ## 3) Set the VAMT tags up to be ready for rollback 310 | 311 | Much like the migration, the VAMT tags on the VMs are used to drive the rollback state as it executes. Before the rollback operation is initiated, the VMs need to have any former VAMT tags (like complete, completeWithErrors, etc.) removed and then the VAMT tag set indicating they are ready to rollback, as shown below: 312 | 313 | ![Set readyToRollback VAMT tag on VMs you want to roll back](./images/VAMT-RollbackVMs_2.jpg) 314 | 315 | ## 4) Execute the rollback 316 | In this example, even though the target cluster, network, and datastore show the blue cluster information, since the VMs currently reside on the blue cluster and the operation is a rollback, the stored information in the custom attributes will move it back to the green cluster. 317 | 318 | ``` 319 | PS C:\Users\admin\Test\vamt_dir> .\TestMigrate.ps1 320 | Transcript started, output file is C:\Users\admin\Test\vamt_dir\vamt_runlogs\20220719-103518/transcript-20220719T1035181154.log 321 | [Info] 07/19/2022 10:35:18 - Beginning inputs file validation. 322 | [Info] 07/19/2022 10:35:18 - Inputs CSV file successfully validated for completeness. 323 | [Info] 07/19/2022 10:35:18 - Change window start time: 07/11/2022 13:16:58 324 | [Info] 07/19/2022 10:35:18 - Change window does not have an end time. 325 | [Info] 07/19/2022 10:35:18 - Current time (07/19/2022 10:35:18) is within the specified change window. Proceeding with script now. 326 | [Debug] 07/19/2022 10:35:18 - No credential for vCenter 10.254.251.40 was passed in via input parameter. Starting stored credential retrieval. 327 | [Debug] 07/19/2022 10:35:18 - Found credential for vCenter 10.254.251.40. User: administrator@vsphere.local 328 | [Info] 07/19/2022 10:35:18 - Logging in to vCenter 10.254.251.40 with User: administrator@vsphere.local 329 | [Info] 07/19/2022 10:35:20 - All tags and categories have been validated. 330 | [Info] 07/19/2022 10:35:20 - Found vm attribute 'vamtSourcevCenterName' in vCenter '10.254.251.40'. No action required. 331 | [Info] 07/19/2022 10:35:20 - Found vm attribute 'vamtSourceESXiHostId' in vCenter '10.254.251.40'. No action required. 332 | [Info] 07/19/2022 10:35:20 - Found vm attribute 'vamtSourceResourcePoolId' in vCenter '10.254.251.40'. No action required. 333 | [Info] 07/19/2022 10:35:20 - Found vm attribute 'vamtSourceFolderId' in vCenter '10.254.251.40'. No action required. 334 | [Info] 07/19/2022 10:35:20 - Found vm attribute 'vamtSourceDatastoreId' in vCenter '10.254.251.40'. No action required. 335 | [Info] 07/19/2022 10:35:20 - Found vm attribute 'vamtSourcePortgroupId' in vCenter '10.254.251.40'. No action required. 336 | [Info] 07/19/2022 10:35:20 - Found vm attribute 'vamtLastMigrationTime' in vCenter '10.254.251.40'. No action required. 337 | [Info] 07/19/2022 10:35:20 - Found vm attribute 'vamtSnapshotName' in vCenter '10.254.251.40'. No action required. 338 | [Info] 07/19/2022 10:35:22 - Pre-rollback target states: 339 | 340 | tgt_vm tgt_vc tgt_host tgt_respool tgt_folder tgt_network tgt_datastore tgt_snapshot tag_state job_state 341 | ------ ------ -------- ----------- ---------- ----------- ------------- ------------ --------- --------- 342 | Win2012r2-1 10.254.251.40 exotic-dory.maas Resources test_net_1 VLAN819-Green Green VAMT_Migration_7_18_2022_1:34:26_PM readyToRollback readyToRollback 343 | Win2012r2-2 10.254.251.40 exotic-dory.maas Resources test_net_1 VLAN819-Green Green VAMT_Migration_7_18_2022_1:34:26_PM readyToRollback readyToRollback 344 | Win2012r2-3 10.254.251.40 fleet-llama.maas Resources test_net_1 VLAN819-Green Green VAMT_Migration_7_18_2022_1:34:26_PM readyToRollback readyToRollback 345 | Win2012r2-4 10.254.251.40 fleet-llama.maas Resources test_net_1 VLAN819-Green Green VAMT_Migration_7_18_2022_1:34:26_PM readyToRollback readyToRollback 346 | Win2012r2-5 10.254.251.40 bright-cattle.maas Resources test_net_1 VLAN819-Green Green VAMT_Migration_7_18_2022_1:34:26_PM readyToRollback readyToRollback 347 | 348 | [Info] 07/19/2022 10:35:22 - There are currently 0 moves in progress and 5 moves waiting to start. 349 | [Info] 07/19/2022 10:35:22 - New batch of moves: Win2012r2-4, Win2012r2-5, Win2012r2-3, Win2012r2-1, Win2012r2-2 350 | [Info] 07/19/2022 10:35:58 - There are currently 5 moves in progress and 0 moves waiting to start. 351 | . 352 | . 353 | ``` 354 | At this point, the rollback should show in progress in vcenter, much the same as the migration: 355 | 356 | ![Set readyToRollback VAMT tag on VMs you want to roll back](./images/VAMT-RollbackVMs_3.jpg) 357 | 358 | ## 5) Verify the rollback once completed 359 | Once the rollback has completed, you should receive the same type of operation status summary as received with migration: 360 | ``` 361 | [Info] 07/19/2022 10:43:00 - Preparing to set 'complete' tag on 'Win2012r2-1' 362 | [Info] 07/19/2022 10:43:00 - Successfully to set 'complete' tag on 'Win2012r2-1' 363 | [Info] 07/19/2022 10:43:00 - Preparing to set 'complete' tag on 'Win2012r2-2' 364 | [Info] 07/19/2022 10:43:00 - Successfully to set 'complete' tag on 'Win2012r2-2' 365 | [Info] 07/19/2022 10:43:00 - Preparing to set 'complete' tag on 'Win2012r2-3' 366 | [Info] 07/19/2022 10:43:00 - Successfully to set 'failed' tag on 'Win2012r2-3' 367 | [Info] 07/19/2022 10:43:00 - Preparing to set 'complete' tag on 'Win2012r2-4' 368 | [Info] 07/19/2022 10:43:00 - Successfully to set 'complete' tag on 'Win2012r2-4' 369 | [Info] 07/19/2022 10:43:00 - Preparing to set 'complete' tag on 'Win2012r2-5' 370 | [Info] 07/19/2022 10:43:00 - Successfully to set 'complete' tag on 'Win2012r2-5' 371 | [Info] 07/19/2022 10:43:00 - There are currently 1 moves in progress and 0 moves waiting to start. 372 | [Info] 07/19/2022 10:43:15 - There are currently 1 moves in progress and 0 moves waiting to start. 373 | [Info] 07/19/2022 10:43:30 - VM move job for 'Win2012r2-1' is complete. 374 | [Info] 07/19/2022 10:43:30 - rollback target states: 375 | 376 | tgt_vm tgt_vc tgt_host tgt_respool tgt_folder tgt_network tgt_datastore tgt_snapshot tag_state job_state 377 | ------ ------ -------- ----------- ---------- ----------- ------------- ------------ --------- --------- 378 | Win2012r2-1 10.254.251.40 exotic-dory.maas Resources test_net_1 VLAN819-Green Green VAMT_Migration_7_18_2022_1:34:26_PM rolledBack Completed 379 | Win2012r2-2 10.254.251.40 exotic-dory.maas Resources test_net_1 VLAN819-Green Green VAMT_Migration_7_18_2022_1:34:26_PM rolledBack Completed 380 | Win2012r2-3 10.254.251.40 fleet-llama.maas Resources test_net_1 VLAN819-Green Green VAMT_Migration_7_18_2022_1:34:26_PM rolledBack Completed 381 | Win2012r2-4 10.254.251.40 fleet-llama.maas Resources test_net_1 VLAN819-Green Green VAMT_Migration_7_18_2022_1:34:26_PM rolledBack Completed 382 | Win2012r2-5 10.254.251.40 bright-cattle.maas Resources test_net_1 VLAN819-Green Green VAMT_Migration_7_18_2022_1:34:26_PM rolledBack Completed 383 | 384 | [Info] 07/19/2022 10:43:30 - Script run summary: 385 | Script start: '07/19/2022 10:35:18' 386 | Script runtime: 8 minutes 387 | Script completion: '07/19/2022 10:43:30' 388 | [Info] 07/19/2022 10:43:30 - Final report: 389 | 390 | tgt_folder tgt_network job_result 391 | ---------- ----------- ---------- 392 | test_net_1 VLAN819-Green Successfully rolled back VM 'Win2012r2-1'. 393 | test_net_1 VLAN819-Green Successfully rolled back VM 'Win2012r2-2'. 394 | test_net_1 VLAN819-Green Successfully rolled back VM 'Win2012r2-3'. 395 | test_net_1 VLAN819-Green Successfully rolled back VM 'Win2012r2-4'. 396 | test_net_1 VLAN819-Green Successfully rolled back VM 'Win2012r2-5'. 397 | [Info] 07/19/2022 10:43:30 - Preparing to send final status email. 398 | ``` 399 | As with the migration example, you can also validate the rollback via vcenter or via PowerCLI script calls to read the VM state. 400 | 401 | # Cleanup 402 | Once migration and/or rollback operations are completed, the cleanup operation can be used to remove the snapshots and custom attributes that were stored during their execution. 403 | 404 | As you can see from the migration and rollback operation examples, the snapshots that are created may tend to accrue on the system over time; on large deployments these represent wasted space. The job of the cleanup operation action is to clean these snapshots up, remove any VAMT tags, and remove the custom attributes that were set up once the migration and/or rollback operations are completed. 405 | 406 | ![Set readyToRollback VAMT tag on VMs you want to roll back](./images/VAMT-CleanupVMs_1.jpg) 407 | 408 | As mentioned before, the rollback and cleanup execution mechanisms are virtually identical to migration; the simplest approach to cleaning up is to replace the operation action in the input @options with “cleanup” action and they use the same .CSV file as input. 409 | 410 | ![Set readyToRollback VAMT tag on VMs you want to roll back](./images/VAMT-CleanupVMs_2.jpg) 411 | 412 | For cleanup, however, as with rollback, only the VM names in the input .CSV file are used; the cluster/host, network, and datastore are ignored, and the required cleanup information comes from the snapshot and custom attributes. 413 | -------------------------------------------------------------------------------- /wiki/Script_Prerequisites.md: -------------------------------------------------------------------------------- 1 | # VAMT Requirements 2 | ## Table of Contents 3 | - [Prerequisites](#prerequisites) 4 | + [PowerShell](#powershell) 5 | + [Operating Systems](#operating-systems) 6 | + [Platform](#platform) 7 | + [Access](#access) 8 | + [Connectivity](#connectivity) 9 | - [Setup](#setup) 10 | + [vCenter Tags](#vcenter-tags) 11 | + [PowerCLI](#powercli) 12 | + [Source Code](#source-code) 13 | 14 | # Prerequisites 15 | 16 | In order to execute the VAMT, there are several prerequisite requirements. These requirements are outlined in the sections below. 17 | 18 | ### PowerShell 19 | 20 | This project has been built leveraging the following components: 21 | * [**Windows PowerShell 5.1**](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_windows_powershell_5.1?view=powershell-5.1) 22 | * [**PowerCLI 12.6+**](https://www.powershellgallery.com/packages/VMware.PowerCLI/12.6.0.19610541) 23 | 24 | ### Operating Systems 25 | 26 | * Microsoft Windows Server 2019 27 | * Microsoft Windows 10 28 | > **Note** 29 | > 30 | > The aforementioned operating systems have been confirmed, but any OS with Windows PowerShell 5.1 should suffice. 31 | 32 | ### Platform 33 | 34 | * VMware vSphere 7.0+ 35 | > **Note** 36 | > 37 | > The aforementioned version(s) have been confirmed, but earlier versions may also be compatible. 38 | 39 | ### Access 40 | 41 | * It is required to have *Administrator* access on the Windows OS where the script will be executed. 42 | * It is recommended to have *Administrator* access in the vCenter(s) where the target VMs live. 43 | 44 | ### Connectivity 45 | 46 | * Ability to connect to your vCenter Server from your Windows OS using PowerCLI. 47 | * See: [Connect to a vCenter Server System](https://developer.vmware.com/docs/15315/powercli-user-s-guide/GUID-1FE80126-ADE6-45AC-A568-AA6CD849DA81.html) 48 | * Ability to connect to your SMTP server from your Windows OS using PowerShell* 49 | * See: [Send-MailMessage](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-5.1) 50 | * Ability to send syslog traffic to your syslog collector from your Windows OS* 51 | > **Note** 52 | > 53 | > *Only required if using these features. 54 | 55 | 56 | # Setup 57 | 58 | In order to execute the VAMT, there are configuration steps required in vCenter as outlined below. 59 | 60 | ## vCenter Tags 61 | 62 | * A Tag Category named **`VAMT`** must exist on each vCenter where target VMs live. 63 | - Single Cardinality required for the Category. 64 | - Scope on the Category should be `VirtualMachine`. 65 | * The following tags must exist in the **`VAMT`** category on each vCenter: 66 | - complete 67 | - completeWithErrors 68 | - readyToMigrate 69 | - readyToRollback 70 | - inProgress 71 | - failed 72 | - rolledBack 73 | 74 | ## PowerCLI 75 | * PowerCLI should be installed and configured according to the documentation here: [ PowerCLI Installation Guide ](https://developer.vmware.com/powercli/installation-guide) 76 | 77 | ## Source Code 78 | 79 | * Pull the [VMwareArchitectureMigrationTool.ps1](../VMwareArchitectureMigrationTool.ps1) script down to a location where you have read/write access on your Windows OS. 80 | * Pull the [VAMT.psm1](../VAMT.psm1) module down to the same directory where [VMwareArchitectureMigrationTool.ps1](../VMwareArchitectureMigrationTool.ps1) sits. -------------------------------------------------------------------------------- /wiki/Script_Usage.md: -------------------------------------------------------------------------------- 1 | # VAMT Usage 2 | ## Table of Contents 3 | 4 | - [Inputs](#inputs) 5 | * [action](#action) 6 | * [inputFilePath](#inputfilepath) 7 | * [vCenters](#vcenters) 8 | * [vcCredentials](#vcCredentials) 9 | * [changeWindowStart](#changewindowstart) 10 | * [changeWindowDuration](#changewindowduration) 11 | * [parallelTaskCount](#paralleltaskcount) 12 | * [jobRetries](#jobretries) 13 | * [statusRefreshInterval](#statusrefreshinterval) 14 | * [osShutdownTimeout](#osshutdowntimeout) 15 | * [osPowerOnTimeout](#ospowerontimeout) 16 | * [syslogHost](#sysloghost) 17 | * [smtpServer](#smtpserver) 18 | * [toEmail](#toemail) 19 | * [fromEmail](#fromemail) 20 | * [secureMailCred](#securemailcred) 21 | * [useMailCred](#usemailcred) 22 | * [smtpUseSsl](#smtpusessl) 23 | * [ignoreVmTools](#ignorevmtools) 24 | * [ignoreTags](#ignoretags) 25 | * [forcePowerOff](#forcepoweroff) 26 | * [powerOnIfRollback](#poweronifrollback) 27 | * [debugLogging](#debuglogging) 28 | * [WhatIf](#whatif) 29 | - [Execution Examples](#execution-examples) 30 | * [Run using named parameters on the command line](#run-using-named-parameters-on-the-command-line) 31 | * [Run using splatting](#run-using-splatting) 32 | * [Run with change window](#run-with-change-window) 33 | * [Run with authenticated email](#run-with-authenticated-email) 34 | * [Run with Syslog forwarding](#run-with-syslog-forwarding) 35 | 36 | # Inputs 37 | 38 | ## action 39 | The action to be performed by the script. 40 | ``` 41 | Input type | String 42 | Required | true 43 | Allowed values | migrate, rollback, cleanup 44 | ``` 45 | 46 | ## inputFilePath 47 | Full path to the input file. This can be a csv file or a json file. See examples: [toMigrate.csv](../example/toMigrate.csv) & [toMigrate.json](../example/toMigrate.json). 48 | ``` 49 | Input type | String 50 | Required | true 51 | Example value | "c:\temp\migrations.csv" 52 | ``` 53 | 54 | ## vCenters 55 | List of vCenter Hostnames or IPs where target VMs live. 56 | ``` 57 | Input type | String[] 58 | Required | true 59 | Example values | "vcenter01.corp.local" OR @("vcenter01.corp.local","vcenter02.corp.local") 60 | ``` 61 | 62 | ## vcCredentials 63 | This parameter should either be a single PSCredential object to be used to connect to all specified [vCenters](#vcenters), OR an ordered array of PSCredential objects where the length matches the specified vCenters list and each element in this vcCredentials array will be used to authenticate to the corresponding element in the [vCenters](#vcenters) array. 64 | 65 | When this parameter is used, it will overwrite any credential currently stored for the specified vCenters. 66 | 67 | If not set, a lookup will occur to find the credential(s) for each [vCenters](#vcenters) element stored locally. If not found, the user will be prompted for a credential and that credential will be stored (encrypted) on the filesystem for future retrieval. 68 | ``` 69 | Input type | PSCredential[] 70 | Required | false 71 | Example values | @((Get-Credential -Message "Enter vc01 creds"),(Get-Credential -Message "Enter vc02 creds")) 72 | ``` 73 | 74 | ## changeWindowStart 75 | If set, the script will validate the specified time and act in the following ways: 76 | * If input time is in the future -> create a scheduled task for the specified time to rerun the script 77 | * If input time is in the past or present -> check [changeWindowDuration](#changewindowduration) 78 | * If current time is > [changeWindowStart](#changewindowstart) AND < ([changeWindowStart](#changewindowstart) + [changeWindowDuration](#changewindowduration)) -> we are within the change window so execute the script 79 | * If current time is past change window duration -> error message and exit the script 80 | ``` 81 | Input type | String 82 | Required | false 83 | Example values | "6/9/2022 9:16:58" 84 | ``` 85 | 86 | ## changeWindowDuration 87 | Duration in Minutes that the changewindow should last. If not set, the default (0) of unlimited duration will be used. 88 | ``` 89 | Input type | Int32 90 | Required | false 91 | Default value | 0 92 | Example value | 90 93 | ``` 94 | 95 | ## parallelTaskCount 96 | Number of concurrent [action](#action) jobs that should run. 97 | ``` 98 | Input type | Int32 99 | Required | false 100 | Default value | 10 101 | ``` 102 | 103 | ## jobRetries 104 | Number of retries that should be attempted if the VM has active vCenter Tasks preventing the [action](#action) OR a retriable error occurs during the action. 105 | ``` 106 | Input type | Int32 107 | Required | false 108 | Default value | 5 109 | ``` 110 | 111 | ## statusRefreshInterval 112 | Amount of time between polls of the main job queue loop. This can be tuned for more or less frequent updates. At scale, a lower value could speed up total execution time since there will be less waiting between checks, however this will come at the expense of increased demand on the script host and increased noise in the logs. 113 | ``` 114 | Input type | Int32 115 | Required | false 116 | Default value | 15 117 | ``` 118 | ## osShutdownTimeout 119 | Amount of time in seconds to wait when shutting down a guest os before we time out. A timeout will result in a failed migration/rollback job. 120 | ``` 121 | Input type | Int32 122 | Required | false 123 | Default value | 600 124 | ``` 125 | ## osPowerOnTimeout 126 | Amount of time in seconds to wait for VMtools to start when powering on a VM post migration. A timeout will result in a failed migration/rollback job. 127 | ``` 128 | Input type | Int32 129 | Required | false 130 | Default value | 900 131 | ``` 132 | 133 | ## syslogHost 134 | Syslog host that all logs from the script execution will be forwarded to. The format is `ip/fqdn:port` where `port` is optional. 135 | ``` 136 | Input type | String 137 | Required | false 138 | Example value | log.corp.local OR 192.168.10.50:514 139 | Default Port | 514 140 | ``` 141 | 142 | ## smtpServer 143 | SMTP server where the final report of the script execution will be sent. The format is `ip/fqdn:port` where `port` is optional. 144 | > **Note**: If you are attempting to use SSL/TLS with your SMTP server, be sure to reference [smtpUseSsl](#smtpUseSsl). 145 | ``` 146 | Input type | String 147 | Required | false 148 | Example value | smtp.corp.local OR smtp.corp.local:458 149 | Default Port | 25 150 | ``` 151 | 152 | ## toEmail 153 | Email address(es) where the final report of the script execution will be sent. 154 | ``` 155 | Input type | String[] 156 | Required | Only if SMTP server is specified. 157 | Example value | jack@corp.local OR @("jack@corp.local","rachell@corp.local") 158 | ``` 159 | 160 | ## fromEmail 161 | Email address that the final report of the script execution will be sent from. 162 | ``` 163 | Input type | String 164 | Required | Only if SMTP server is specified. 165 | Example value | jack@corp.local 166 | ``` 167 | 168 | ## secureMailCred 169 | Credential to be used for authenticated to the SMTP server. If specified, this credential will set/replace an encrypted credential file for the specified smtp server. 170 | ``` 171 | Input type | PSCredential 172 | Required | false 173 | Example value | (Get-Credential -Message "Enter SMTP creds") 174 | ``` 175 | 176 | ## useMailCred 177 | Switch that if specified will retrieve an encrypted credential from the filesystem for the specified smtp server. 178 | ``` 179 | Input type | Switch 180 | Required | false 181 | ``` 182 | 183 | ## smtpUseSsl 184 | Switch that will enable secure smtp. 185 | ``` 186 | Input type | Switch 187 | Required | false 188 | ``` 189 | 190 | ## ignoreVmTools 191 | Switch that will cause the script to ignore the pre and post migration VM tools state when a migration [action](#action) is specified. If not selected, the script will only start the migration IF VMware tools is running and will only successfully complete IF VMware tools is running after the migration completes. 192 | ``` 193 | Input type | Switch 194 | Required | false 195 | ``` 196 | 197 | ## ignoreTags 198 | Switch that will cause the script to ignore the [tag validation](./Script_Prerequisites.md#vcenter-tags) that occurs on each VM before each migration [action](#action) job. 199 | ``` 200 | Input type | Switch 201 | Required | false 202 | ``` 203 | 204 | ## forcePowerOff 205 | Switch that will cause the VM to be forced to power off if the shutdown guest os operation has not completed within the timeout threshold. 206 | ``` 207 | Input type | Switch 208 | Required | false 209 | ``` 210 | 211 | ## powerOnIfRollback 212 | Switch that will cause the VM to be powered on after rollback has been completed. 213 | ``` 214 | Input type | Switch 215 | Required | false 216 | ``` 217 | 218 | ## debugLogging 219 | Switch that will enable more detailed logging to the console AND execution log file. 220 | ``` 221 | Input type | Switch 222 | Required | false 223 | ``` 224 | 225 | ## WhatIf 226 | Switch that will enable a test mode of the script where no actions will be applied on the target VMs but everything will be validated. 227 | ``` 228 | Input type | Switch 229 | Required | false 230 | ``` 231 | 232 | # Execution Examples 233 | 234 | ## Run using named parameters on the command line 235 | ``` 236 | ./VMwareArchitectureMigrationTool.ps1 -action "migrate" -inputFilePath "c:\temp\toMigrate.csv" -vCenters "vcenter01.corp.local" 237 | ``` 238 | 239 | ## Run using splatting 240 | ``` 241 | $options = @{ 242 | action = "migrate" 243 | vcenters = "vcenter01.corp.local" 244 | inputFilePath = "c:\temp\toMigrate.csv" 245 | } 246 | .\VMwareArchitectureMigrationTool.ps1 @options 247 | ``` 248 | 249 | ## Run with change window 250 | ``` 251 | $options = @{ 252 | action = "migrate" 253 | vcenters = "vcenter01.corp.local" 254 | inputFilePath = "c:\temp\toMigrate.csv" 255 | changeWindowStart = "7/11/2022 13:16:58" 256 | changeWindowDuration = 180 257 | parallelTaskCount = 10 258 | } 259 | .\VMwareArchitectureMigrationTool.ps1 @options 260 | ``` 261 | 262 | ## Run with authenticated email 263 | ``` 264 | # SMTP credentials setup 265 | [string]$userName = 'account@corp.local' 266 | [string]$userPassword = 'password' 267 | [securestring]$secStringPassword = ConvertTo-SecureString $userPassword -AsPlainText -Force 268 | [pscredential]$credObject = New-Object System.Management.Automation.PSCredential($userName, $secStringPassword) 269 | 270 | $options = @{ 271 | action = "migrate" 272 | vcenters = "vcenter01.corp.local" 273 | inputFilePath = "c:\temp\toMigrate.csv" 274 | toEmail = "team@corp.com" 275 | fromEmail = "account@corp.local" 276 | smtpServer = "smtpserver.corp.local:port" 277 | secureMailCred = $credObject 278 | smtpUseSsl = $true 279 | debugLogging = $true 280 | } 281 | .\VMwareArchitectureMigrationTool.ps1 @options 282 | ``` 283 | 284 | ## Run with Syslog forwarding 285 | ``` 286 | $options = @{ 287 | action = "migrate" 288 | vcenters = "vcenter01.corp.local" 289 | inputFilePath = "c:\temp\toMigrate.csv" 290 | parallelTaskCount = 5 291 | syslogHost = "syslog.corp.local:port" 292 | debugLogging = $true 293 | } 294 | .\VMwareArchitectureMigrationTool.ps1 @options 295 | ``` 296 | 297 | # Troubleshooting 298 | 299 | ## Debugging PS Job 300 | Within the VAMT module there are multiple functions which spin up a PS job to perform the task at hand. 301 | ``` 302 | Start-MigrateVMJob 303 | Start-RollbackVMJob 304 | Start-CleanupVMJob 305 | ``` 306 | If a user/developer finds themself in a scenario where an issue is occuring within one of these jobs and the reason cannot be determined from the job details or job logging, debugging the job may be necessary. To perform this task, here are the basic steps to get you started. 307 | ``` 308 | #Put the following Commandlet at the top of the appropriate job script block withing VAMT module 309 | Wait-Debugger 310 | ``` 311 | E.X.: 312 | ``` 313 | $migrationJob = Start-Job -ScriptBlock { 314 | param ($srcViConn,$tgtViConn,$vm,$compute,$network,$vmfolder,$storage,$retry,$test,$scriptVars) 315 | Wait-Debugger 316 | try { 317 | ...... 318 | ``` 319 | Next, execute the VMwareArchitectureMigrationTool.ps1 script as you have been doing effectively reproducing the error you are seeing. 320 | > **Note**: It may be advantageous for you to only execuite the script with a single VM target to reduce setup/cleanup complexity. 321 | 322 | You should see the error shown below when running the script as `AtBreakpoint` is not a valid job state, this is expected. Now, from the current shell where the script was executed, run the following commands: 323 | ``` 324 | #This command will produce a list of current PSJobs. Note the Id of one that contains the State AtBreakpoint 325 | Get-Job 326 | #Get the active PS runspace for the appropriate job 327 | $runspc = (Get-Job -Id ).ChildJobs.Runspace 328 | #Enter an interactive debug session within the Job 329 | $runspc | Debug-Runspace 330 | ``` -------------------------------------------------------------------------------- /wiki/images/VAMT-CleanupVMs_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-CleanupVMs_1.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-CleanupVMs_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-CleanupVMs_2.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-EnablingDRS_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-EnablingDRS_1.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-EnablingDRS_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-EnablingDRS_2.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-ExampleVMList.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-ExampleVMList.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-ExampleVMList_AssignTags_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-ExampleVMList_AssignTags_1.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-ExampleVMList_AssignTags_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-ExampleVMList_AssignTags_2.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-ExampleVMList_AssignTags_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-ExampleVMList_AssignTags_3.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-ExampleVMList_RemoveTags_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-ExampleVMList_RemoveTags_1.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-MigrateVMs_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-MigrateVMs_1.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-MigrateVMs_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-MigrateVMs_2.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-MigrateVMs_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-MigrateVMs_3.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-MigrateVMs_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-MigrateVMs_4.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-MigrateVMs_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-MigrateVMs_5.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-MigrateVMs_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-MigrateVMs_6.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-RollbackVMs_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-RollbackVMs_1.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-RollbackVMs_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-RollbackVMs_2.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-RollbackVMs_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-RollbackVMs_3.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-Scripting_Tool_Process-cleanup_controller.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-Scripting_Tool_Process-cleanup_controller.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-Scripting_Tool_Process-cleanup_process.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-Scripting_Tool_Process-cleanup_process.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-Scripting_Tool_Process-conceptual_model.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-Scripting_Tool_Process-conceptual_model.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-Scripting_Tool_Process-main.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-Scripting_Tool_Process-main.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-Scripting_Tool_Process-migrate_process.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-Scripting_Tool_Process-migrate_process.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-Scripting_Tool_Process-migration_controller_process.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-Scripting_Tool_Process-migration_controller_process.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-Scripting_Tool_Process-rollback_controller.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-Scripting_Tool_Process-rollback_controller.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-Scripting_Tool_Process-rollback_process.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-Scripting_Tool_Process-rollback_process.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-SettingUpTags_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-SettingUpTags_1.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-SettingUpTags_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-SettingUpTags_2.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-SettingUpTags_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-SettingUpTags_3.jpg -------------------------------------------------------------------------------- /wiki/images/VAMT-SettingUpTags_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-samples/vmware-architecture-migration-tool/82463fed6dca2b16a90621630244ccf183d704ee/wiki/images/VAMT-SettingUpTags_4.jpg --------------------------------------------------------------------------------