https://vbombarded.wordpress.com/2015/02/20/vrealize-orchestrator-extend-virtual-disk-workflow/

var devices = vm.config.hardware.device;
System.log(devices) for (i in devices){
if (devices[i].deviceInfo.label == diskString){
var disk = devices[i]
System.log("Disk = " + disk.deviceInfo.label)
}
} var newSizeKB = disk.capacityInKB + (increaseSizeGB * 1024 * 1024)
System.log("New Size KB = " + newSizeKB) var spec = new VcVirtualMachineConfigSpec();
spec.changeVersion = vm.config.changeVersion;
spec.deviceChange = System.getModule("com.vmware.onyx").array(VcVirtualDeviceConfigSpec, 1);
spec.deviceChange[0] = new VcVirtualDeviceConfigSpec();
spec.deviceChange[0].operation = VcVirtualDeviceConfigSpecOperation.edit;
spec.deviceChange[0].device = new VcVirtualDisk();
spec.deviceChange[0].device.key = disk.key;
spec.deviceChange[0].device.deviceInfo = new VcDescription();
spec.deviceChange[0].device.deviceInfo.label = disk.deviceInfo.label;
spec.deviceChange[0].device.deviceInfo.summary = disk.deviceInfo.summary;
spec.deviceChange[0].device.backing = new VcVirtualDiskFlatVer2BackingInfo();
spec.deviceChange[0].device.backing.fileName = disk.backing.fileName;
spec.deviceChange[0].device.backing.diskMode = disk.backing.diskMode;
spec.deviceChange[0].device.backing.split = disk.backing.split;
spec.deviceChange[0].device.backing.writeThrough = disk.backing.writeThrough;
spec.deviceChange[0].device.backing.thinProvisioned = disk.backing.thinProvisioned;
spec.deviceChange[0].device.backing.uuid = disk.backing.uuid;
spec.deviceChange[0].device.backing.contentId = disk.backing.contentId;
spec.deviceChange[0].device.backing.digestEnabled = disk.backing.digestEnabled;
spec.deviceChange[0].device.controllerKey = disk.controllerKey;
spec.deviceChange[0].device.unitNumber = disk.unitNumber;
spec.deviceChange[0].device.capacityInKB = newSizeKB;
spec.deviceChange[0].device.shares = new VcSharesInfo();
spec.deviceChange[0].device.shares.shares = disk.shares.shares;
spec.deviceChange[0].device.shares.level = disk.shares.level;
spec.deviceChange[0].device.storageIOAllocation = new VcStorageIOAllocationInfo();
spec.deviceChange[0].device.storageIOAllocation.limit = disk.storageIOAllocation.limit;
spec.deviceChange[0].device.storageIOAllocation.shares = new VcSharesInfo();
spec.deviceChange[0].device.storageIOAllocation.shares.shares = disk.storageIOAllocation.shares.shares;
spec.deviceChange[0].device.storageIOAllocation.shares.level = disk.storageIOAllocation.shares.level; return vm.reconfigVM_Task(spec);

vRO Extend VirtualDisk Workflow的更多相关文章

  1. 创建一个dynamics CRM workflow (一) - Introduction to Custom Workflows

    Workflow: Use this process to model and automate real world business processes. These processes can ...

  2. [转]Reducing script compile time or a better workflow to reduce excessive recompiling

    http://forum.unity3d.com/threads/148078-Reducing-script-compile-time-or-a-better-workflow-to-reduce- ...

  3. $.extend()的实现源码 --(源码学习1)

    目标: $.extend({         add:function(a,b){             return a + b;         }     }) console.log($.a ...

  4. Mac 词典工具推荐:Youdao Alfred Workflow(可同步单词本)

    想必大家都有用过 Mac 下常见的几款词典工具: 特性 系统 Dictionary 欧路词典 Mac 版 有道词典 Mac 版 在线搜索 ✗ ✔ ✔ 屏幕取词 ☆☆☆ ★★☆ ★☆☆ 划词搜索 ★★★ ...

  5. 图片放大功能插件及jquery.extend函数理解

    前端时间,产品提出社区评论中的图片需要有放大功能.感觉可以共用,所以就想整合一个插件,过程中也借鉴了一些例子. 分析下自己的代码思路: var scaleImg = function(opts) { ...

  6. $.extend({},defaults, options) --(初体验三)

    1.$.extend({},defaults, options) 这样做的目的是为了保护包默认参数.也就是defaults里面的参数. 做法是将一个新的空对象({})做为$.extend的第一个参数, ...

  7. jquery.fn.extend与jquery.extend--(初体验二)

    1.jquery.extend(object); 为扩展jQuery类本身.为类添加新的方法. jquery.fn.extend(object);给jQuery对象添加方法. $.extend({ a ...

  8. SharePoint 2013 create workflow by SharePoint Designer 2013

    这篇文章主要基于上一篇http://www.cnblogs.com/qindy/p/6242714.html的基础上,create a sample workflow by SharePoint De ...

  9. Install and Configure SharePoint 2013 Workflow

    这篇文章主要briefly introduce the Install and configure SharePoint 2013 Workflow. Microsoft 推出了新的Workflow ...

随机推荐

  1. 关于 SQLNET.AUTHENTICATION_SERVICES 验证方式的说明

    今天去客户那里巡检,客户提出为了提高数据库安全性考虑,须要改动sys/systempassword,并通过数据库验证方式来代替默认的操作系统方式,如今我来把这两种验证方式总结一下. 操作系统验证.即通 ...

  2. Java_cpu飙升排查

    1.现象 top 2.根据上图找到进程ID=28790 3.查找28790下线占用cpu高的线程ID -o THREAD,tid,time 4.根据上图发现线程ID=29161,换算成16进制 pri ...

  3. iOS Document Interaction 编程指南

    本文转载至 http://www.2cto.com/kf/201306/219382.html iOS支持在你的app中用其他app预览和显示文档.iOS还支持文件关联,允许其他app通过你的程序打开 ...

  4. 索引笔记《一》Oracle中的索引详解

    一. ROWID的概念 存储了row在数据文件中的具体位置:64位 编码的数据,A-Z, a-z, 0-9, +, 和 /, row在数据块中的存储方式 SELECT ROWID, last_name ...

  5. JavaScript中的对象类型详解

    To be finished 摘要 1.什么是对象? 2.引用类型和原始类型 3.对象数据属性拥有的特性(Attributes) 4.如何创建对象 a.直接定义 var mango={color:&q ...

  6. 【BZOJ1053】[HAOI2007]反素数ant 暴力

    [BZOJ1053][HAOI2007]反素数ant Description 对于任何正整数x,其约数的个数记作g(x).例如g(1)=1.g(6)=4.如果某个正整数x满足:g(x)>g(i) ...

  7. 路径 php中'.'和'..'还有'./'和'../'

    ./当前目录(就是当前执行文件所在目录) ../上级目录 / 这个才是根目文件名/ 同级目录 例子如图 1.cart下的index.php 1)要引用Public->css->index. ...

  8. client-server model peer-to-peer architecture 主从式架构

    w https://zh.wikipedia.org/wiki/主从式架构 主从式架构 (Client–server model) 或客户端-服务器(Client/Server)结构简称C/S结构,是 ...

  9. ECMAScript6箭头函数ArrowFunction"=>"

    一.说明 ECMAScript6可以用箭头"=>"定义函数.x => x * x或(x) => {return x * x;}与匿名函数function(x){r ...

  10. Testlink安装:Notice:Undefined index: type in C:\inetpub\wwwroot\testlink-1.9.3\install\installCheck.php on line 41

    问题现象: