Powercli随笔 - PowerCLI script to sequentially Storage vMotion VMs from a CSV File
PowerCLI script to sequentially Storage vMotion VMs from a CSV File
This is a PowerCLI script that I use to Storage vMotion (s/vmotion) VMs from an input file (CSV File). This helps me evacuate VMs from a datastore that will be decommissioned and this serves like an automation. With this, I do not have to log back to vCenter and manually do storage migrations. This also have a lesser performance impact compared to simultaneously queuing storage migrations manually in case this will be done on non-peak hours.
|
1
2
3
4
5
6
7
8
|
$VMsToRelocate = Import-Csv "ListOfVMsToRelocate.csv"$Datastore = Get-Datastore -Name "datastore_name"foreach ($VM in $VMsToRelocate){Write-Host "Relocating VM:" $VM.Name "to" $DatastoreGet-VM -Name $VM.Name | Move-VM -datastore $Datastore > $null}Write-Host "Completed!" |
Note that the CSV file must have a Header called Name, below is an example.
|
1
2
3
4
|
NameVM1VM2VM3 |
If you want to export the list of VMs that you want to migrate, you can use RV Tools to generate a VM Inventory, export the list to MS Excel, do your filtering there (such as filter by the storage path), and I personally like to sort them by used size (in MB), then simply copy-paste to the CSV file. You do not need to create the CSV file in Excel, I use Notepad++.
Powercli随笔 - PowerCLI script to sequentially Storage vMotion VMs from a CSV File的更多相关文章
- VMware Storage VMotion概述及功能
可以跨存储阵列实时迁移虚拟机磁盘文件.VMware Storage VMotion 使您可以在共享存储位置之间和跨共享存储位置重新分配虚拟机磁盘文件,同时保证连续的服务供应和事务处理的完整性. 1.可 ...
- vSphere中Storage vMotion的流程详解
内容预览: 1. Storage vMotion的迁移方式 2. 影响Storage vMotion效率的因素 3. Storage vMotion的详细流程 企业部署虚拟化后,如果发现存储的性能出现 ...
- SQL Script for select data from ebs and make a csv file to FTP
DECLARE CURSOR cur_lcy_test IS SELECT rcta.customer_trx_id, rcta.trx_number, rcta.trx_date FROM ra_c ...
- SQL Script for read information from a csv file in FTP Server
DECLARE w_file_path VARCHAR2(4000) := 'XXIF_INPUT'; --all_directories.directory_name w_file_name VAR ...
- 【原创】大数据基础之Benchmark(2)TPC-DS
tpc 官方:http://www.tpc.org/ 一 简介 The TPC is a non-profit corporation founded to define transaction pr ...
- centos7安装powershell和powercli
poershell github https://github.com/PowerShell/PowerShell/releases 本次采用github下载对应的rpm进行安装 windows下安装 ...
- JS检查是否支持Storage
查看效果:http://hovertree.com/code/html5/q69kvsi6.htm 代码: <!DOCTYPE html> <html> <head> ...
- Managing IIS Log File Storage
Managing IIS Log File Storage You can manage the amount of server disk space that Internet Informa ...
- Web Storage事件无法触发
不管是在同源其他页面还是在本页面都不能触发storage事件. <!DOCTYPE html> <html> <head> <meta charset=&qu ...
随机推荐
- 获取jQuery DataTables 的checked选中行
$(function () { var tabel = $('#userlist').DataTable({ destroy: true, //Cannot reinitialise ...
- JavaScript如何获得两点之间顺时针旋转的角度
接上回:如何用javascript中的canvas让图片自己旋转 既然能够制定角度让图片旋转,那么现在要做的是自动获得旋转的角度, 让图片能够随着鼠标的方向旋转,让人物能够面朝鼠标的方向: 源代码: ...
- P3914染色计数
题目描述 有一颗\(N\)个节点的树,节点用\(1,2,\cdots,N\)编号.你要给它染色,使得相邻节点的颜色不同.有\(M\)种颜色,用\(1,2,\cdots,M\)编号.每个节点可以染\(M ...
- mysql处理重复数据仅保留一条记录
目的:去除(或删除)一个表里面手机号重复的数据,但是需要保留其中一个记录,换句话说,表里面手机号不为空的数据,一个手机有且只有一条记录 表结构: CREATE TABLE `account` ( `i ...
- 如何在C#中使用sqlite,一个简单的类
</pre><pre name="code" class="csharp"> using System.Collections.Gene ...
- html标签的target属性应用
1. 定义和用法 target 属性规定在何处打开页面上的所有链接. <head> <base target="_blank" /> </head&g ...
- 关于GeneXus中的ForeachCommand命令
首先作为我们开发过程中必不可少的命令For Each 有着无与伦比的重要性 但是我们从Wiki上得知 我们用到的可能只是它一丢丢的能力并没有全部使用出来. 所以 这篇文档将记 ...
- python基础学习 day 1
初学python,记录下自己的历程~ 了解了一下python的基本概念,现在使用的比较多的就是python2.7 学习了if语句和两个经典的循环语句 #关于if语句的应用 name = raw_inp ...
- Freeswitch Tutorial
I. Install Freeswitch 1) FreeSWITCH Explained https://freeswitch.org/confluence/ https://freeswitch. ...
- 金蝶KIS客户端修改IP连接服务器的方法
问题现象:服务器IP变更后,金蝶KIS客户端打开时提示多个错误,并会自动关闭,无法联网登录 1. 到下面位置修改注册表 Windows Registry Editor Version 5.00 [HK ...