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. SlidingMenu官方实例分析4——AttachExample

    AttachExample这个类没有继承BaseActivity,而是FragmentActivity,写到这好像感悟到了 为什么官方现在都推荐使用Fragment而不是Activity,因为Frag ...

  2. ios UICollectionView reloadData无法更新的奇怪问题。

    报错    Assertion failure in -[UICollectionViewData invalidateItemsAtIndexPaths:] 近来偶尔用到UICollectionVi ...

  3. idea Plugin "Maven Integration Extension" was not loaded: required plugin "Maven Integration" is disabled

    由于自己运行了eclipse maven及idea maven 同时操作,可能产生了以上错误.既: idea  Plugin "Maven Integration Extension&quo ...

  4. shell 命令getopts用法

    写shell脚本常见sh test.sh -m 2 -d 3的写法 事例脚本: #!/bin/bash while getopts ":a:b:c:" arg #选项后面的冒号表示 ...

  5. SharePoint服务器端对象模型 之 访问文件和文件夹(Part 2)

    4.添加文件夹 文件夹的创建方法在文档库和普通列表中稍有不同. 在文档库中,与一般的集合操作相同,直接使用SPFolderCollection的Add(string name)方法即可添加文件夹,例如 ...

  6. POJ 3026 Borg Maze【BFS+最小生成树】

    链接: http://poj.org/problem?id=3026 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22010#probl ...

  7. make tree install 目录树状结构工具安装

    http://futeng.iteye.com/blog/2071867 http://zhou123.blog.51cto.com/4355617/1196415 wget ftp://mama.i ...

  8. BufferedReader.mark()函数注意事项

    BufferedRedder.mark()注意事项,在如下代码u3 = br3.readLine();会出现java.lang.OutOfMemoryError: Java heap space异常. ...

  9. python通过数据库连接池实现mysql数据库增删改查

    import pymysql from DBUtils.PooledDB import PooledDB class SQLHandler(object): def __init__(self, ho ...

  10. android 支付宝集成 使用常见错误

    版权声明:好记星不如烂笔头,欢迎批判转载 https://blog.csdn.net/ab601026460/article/details/34956365 1:自己近期在做了支付.遇到了一下问题先 ...