您现在的位置:主页 > 技术中心 > 操作系统 > 虚拟机

使用vSphere API配置虚拟机(8)

来源:未知 责任编辑:责任编辑 发表时间:2014-01-06 18:17 点击:

                          }
                 }//end while
         }//end if
}//end for
快速归零技术
快速归零紧密磁盘,将分配给 VM 的所有未使用空间清零,并且 VMware vSphere 针对该用途提供了一个 API。完成 解压缩技术 的步骤 1 和步骤 2,在数据存储中检索与 VM 有关联的 VMDK 路径。然后,从 vSphere 调用 eagerzero thick API,清零整个磁盘,如清单 3 所示。
清单 3. 调用 eagerzero thick API,清零整个磁盘
 

p>for (int i = 0; i < path.size(); i++) {
System.out.println("this.vimPort.inflateVirtualDisk_Task("+
    this.virtualDiskManagerMor + "," + path.get(i) + ","+
    dataCenterMor + ");");
ManagedObjectReference taskMor = this.vimPort. eagerZeroVirtualDisk_Task
    (this.virtualDiskManagerMor,(String) path.get(i), dataCenterMor);
         if (taskMor != null) {
                 taskResult = "queued";
                 while ((!taskResult.equals("success"))&&
                     (!taskResult.equals("error"))) {
                          try {
                                   System.out.println("task type:"+ taskMor.getType());
                                   TaskInfo taskInfo =
                                      (TaskInfo) this.getSingleProperty("info",taskMor);
                                   System.out.println("state:"+
                                       taskInfo.getState().getValue());
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片

推荐热点

  • VMware View 5.0从菜鸟到高手系列 -连接虚
  • kvm中的windows使用Vmware的显示驱动
  • VMware Linux使用Xshell登陆
  • 虚拟机安装MAC查看电脑CPU是否支持VT技术
  • VMWare NAT Centos6.2静态ip设置
  • vmware虚拟机浅析-虚拟网卡
  • VirtualBox打开虚拟硬盘失败的问题
  • 给虚拟机提速的方法
  • Virtual Box下同时配置host-only和bridge

快速直达

?? - ?? - ÝřŝžľŘÝź - TAGąęÇŠ - RSSśŠÔÄ - ??
Copyright © 2004-2024 上海卓卓网络科技有限公司