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

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

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

                          }//end if
                 }//end while
 
         }//endif
}//end for

在获得所有与 VM 有关联的 VMDK 文件的路径后,在每个磁盘上使用 vSphere inflate API 调用解压缩功能,如步骤 3 所示。
步骤 3:解压缩 VMDK 文件
现在,通过将在步骤 2 中发现的路径传递给 inflateVirtualDisk_Task 方法,可解压缩 VMDK 文件,如清单 2 所示。
清单 2. 解压缩 VMDK 文件
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.inflateVirtualDisk_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 上海卓卓网络科技有限公司