使用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设置
  • Virtual Box下同时配置host-only和bridge
  • vmware虚拟机浅析-虚拟网卡
  • VirtualBox打开虚拟硬盘失败的问题
  • 给虚拟机提速的方法

快速直达

操作系统导航

LinuxWindows虚拟机
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1