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 ...
随机推荐
- python math 模块
数学模块 引入模块:import math 注意: 使用某个模块下的函数,必须先引入这个模块,否则无法正常使用. ceil() 向上取整操作 格式:math.ceil(数值) 返回值:整型 floor ...
- python3.7.0 安装与配置
python 3.7.0 X64下载地址: https://www.python.org/ftp/python/3.7.0/python-3.7.0-amd64.exe 更多版本下载请移步到:http ...
- python包的补充
1.包A和包B下有同名模块也不会冲突,如A.a与B.a来自俩个命名空间 2.常见目录结构 import os 2 os.makedirs('glance/api') 3 os.makedirs('gl ...
- forEach究竟能不能改变数组的值
forEach究竟能不能改变数组的值 :https://blog.csdn.net/ZhengKehang/article/details/81281563 初学者每次提到Array对象的时候有些烦人 ...
- Springboot-技术专区-war包部署在Tomcat上并修改默认端口
springboot项目内置Tomcat,直接打成jar包在dos下运行即可,但有时我们需要用war包以非内嵌Tomcat的方式来部署,以下是本人的实际经验 1.首先需要修改pom.xml文件 < ...
- vue-devtools工具的安装
vue-devtools是一款基于chrome游览器的插件,用于调试vue应用,这可以极大地提高我们的调试效率.接下来我们就介绍一下vue-devtools的安装 1.登录github,获取到vue- ...
- IDEA中web项目maven项目手动打war包的方式
手动打包 https://blog.csdn.net/ibigboy/article/details/90287963 tomcat部署web项目方法 https://www.cnblogs.com/ ...
- 自定义的最简单的可回调的线程任务CallbackableFeatureTask(模仿google的ListenableFutureTask)
1.使该Task继承Callable,Runable import java.util.concurrent.Callable; import java.util.function.Consumer; ...
- R语言ggplot2软件包
相比r语言自带软件包,ggplot2有以下特色 图形语法的核心:统计图形是数据向几何对象属性的一个映射.
- ActiveMQ修改连接的用户名密码
安装目录下conf/activemq.xml 添加如下内容: <plugins> <simpleAuthenticationPlugin> <users> < ...