vmware / govmomi

Go library for the VMware vSphere API
Apache License 2.0
2.31k stars 911 forks source link

govc add support for conversion - Thick <-> Thin #1998

Open kofec opened 4 years ago

kofec commented 4 years ago

Hi, Is it possible to add optional parameter responsible for format of disk - probably to function datastore.cp Now we have: datastore.cp [OPTIONS] SRC DST and datastore.disk.create - Options:

  -a=lsiLogic            Disk adapter
  -d=thin                Disk format

So we need to adopt options from datastore.disk.create to datastore.cp It looks like both function use VirtualDiskSpe https://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.VirtualDiskManager.VirtualDiskSpec.html https://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.VirtualDiskManager.html#createVirtualDisk https://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.VirtualDiskManager.html#copyVirtualDisk

Now I'm using perl implementation: vmkfstools --server {vihost} -i \"{source_file}\" \"{destination_file}\" -d thin -a lsilogic --vihost {vihost}" https://docs.vmware.com/en/VMware-vSphere/5.5/com.vmware.vsphere.storage.doc/GUID-A5D85C33-A510-4A3E-8FC7-93E6BA0A048F.html

Or maybe some knows how convert disk(2GB data on 100G disk provision) in qcow format(2GB size file) to vmdk( still 2GB size file) - don't want to send 100GB over the network. Import/Upload to datastore and attach disk to Virtual Machine (just replace disk with this new one) on vSphere.

kofec commented 4 years ago

@dougm Regarding your commit https://github.com/vmware/govmomi/commit/d622f149a43481972c674fd8280006de49077d7c#diff-00dcddb30db9dda4f7a547cc1323a7ee

You mentioned that: "- Remove the recently added datastore.disk.cp; the spec param is only valid for ESX" I would like to use this param connection to:

./govc about
Name:         VMware vCenter Server
Vendor:       VMware, Inc.
Version:      6.7.0
Build:        14792544
OS type:      linux-x64
API type:     VirtualCenter
API version:  6.7.3
Product ID:   vpx
github-actions[bot] commented 3 years ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

HeroCC commented 3 years ago

/remove-lifecycle stale

/reopen

github-actions[bot] commented 3 years ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Mark as fresh by adding the comment /remove-lifecycle stale.

HeroCC commented 3 years ago

/remove-lifecycle stale -- is there a way to disable the github actions bot spam? This is still an issue, even if not a high activity / priority one.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Mark as fresh by adding the comment /remove-lifecycle stale.

HeroCC commented 2 years ago

/remove-lifecycle stale

/add-lifecycle frozen

bzed commented 1 year ago

Any news on this issue?