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. ExtJs学习-搭建开发环境

    Extjs是一个非常棒的ajax框架,可以用来开发十分绚丽外观的客户端框架,能使B/S框架更加具有活力.它是一个用javascript编写的框架,与后台技术无关的ajax框架.因此,可以把ExtJs使 ...

  2. OpenCV学习笔记四:ImgProc模块

    一,简介 这个模块包含一系列的常用图像处理算法. 二,分析 此模块包含的文件如下图: 其导出算法包括如下: /*********************** Background statistics ...

  3. js事件绑定的方法

    废话不多少,直接上代码 第一种 <body> <div style="width:400px;height:400px;background:blueviolet" ...

  4. cocos2dx - 部署到android真机上错误整理

    利用Cgywin编译工具来将cocos2dx 在Android运行所需要的C++文件编译 1. ./build_native.sh(最后一把执行出错) please define NDK_ROOT i ...

  5. SQL.Cookbook 读书笔记3 操作多个表

    第三章 操作多个表 表连接的内连接和外连接 A表 B表id name id name 1 a 1 b 2 b 3 c4 c内连接就是左表和右表相同的数据,查询结果只有相等的数据:select * fr ...

  6. Cocos2d-x Lua中使用标签

    游戏场景中的文字包括了静态文字和动态文字.静态文字如下图所示游戏场景中①号文字“COCOS2DX”,动态文字如图4-1所示游戏场景中的②号文字“Hello World”.静态文字一般是由美工使用Pho ...

  7. Highway

    Highway Accepted : 78   Submit : 275 Time Limit : 4000 MS   Memory Limit : 65536 KB Highway In ICPCC ...

  8. EasyNVR现场部署搭配EasyNVS云端集中控制应用于幼儿园直播场景的最佳方案!

    在之前的介绍中,我们已经介绍了很多EasyNVR成功应用于幼儿园类教育直播的场景,例如<EasyDarwin幼教云视频平台在幼教平台领域大放异彩!>.<基于EasyDarwin云视频 ...

  9. 巨蟒python全栈开发django11:ajax&&form表单上传文件contentType

    回顾: 什么是异步? 可以开出一个线程,我发出请求,不用等待返回,可以做其他事情. 什么是同步? 同步就是,我发送出了一个请求,需要等待返回给我信息,我才可以操作其他事情. 局部刷新是什么? 通过jq ...

  10. Truthy Falsy

    https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy falsy(虚值)是在 Boolean 上下文中已认定可转换为‘假‘的值. JavaS ...