zoukankan      html  css  js  c++  java
  • vRO Extend VirtualDisk Workflow

    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);
  • 相关阅读:
    在Android中通过导入静态数据库来提高应用第一次的启动速度
    《sqlite权威指南》读书笔记 (一)
    Android APK反编译详解(附图)
    Android如何防止apk程序被反编译
    PopupWindow 学习总结
    Android开源框架Afinal第一篇——揭开圣女的面纱
    教程] 《开源框架-Afinal》之FinalHttp 01一步一脚
    android 下改变默认的checkbox的 选中 和被选中 图片
    Android设置RadioButton在文字的右边
    Android Selector 与 Shape 基本用法
  • 原文地址:https://www.cnblogs.com/vincenshen/p/9554537.html
Copyright © 2011-2022 走看看