-
Notifications
You must be signed in to change notification settings - Fork 926
govc: Add datastore.cp disk format and adapter options #3758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dougm
wants to merge
2
commits into
vmware:main
Choose a base branch
from
dougm:issue-3748
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+22
−3
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed my own comment here from ~7 years ago. And I'm not seeing a difference now with the spec in place, it seems to be ignored. The target disk is always the same format as the source, regardless of specifying a different
-d
(type). For example copying fromthin
topreallocated
results inthin
:I'll hold off merging for now, will take a closer look at some point too. cc @aklakina
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that is the case?
For example in my use case, I upload a .vmdk to vsphere and then I use datastore.cp to copy it with auto type detection. The disk is created with starwind v2v as file type vsphere_ws_growable, which should be the thin provisioned. This is then uploaded to vsphere esxi host. (I know that esxi is not at all the same as a vsphere workstation, but because of security purposes, the machine running the starwind can not connect directly to esxi host, so it can not use the vsphere_esxi_growable output type.)
So the disk uploaded is thin provisioned (confirmed by size) but the result of cp is eager zeroed. Could the issue be somewhere else?
I haven't tried the changes yet. Will only have time at the start of next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only tested source disk from
datastore.disk.create
, not tried starwind. Ok, let us know how it goes when you are able to test. I'll still try to take a closer look too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've ran the test and can confirm that
govc datastore.cp <source> <dest>
creates an eager zeroed disk on this branch too.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How was it uploaded? scp or ?
Another option to try: https://github.com/vmware/govmomi/blob/main/govc/USAGE.md#importvmdk
This goes through the conversion process, from desktop (streamOptimized) format to thin. After that, you can use
datastore.cp
and target disks will be thin format.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was converted to vsphere workspace growable format and then I used the datastore.upload command.
Sadly the import.vmdk command needs direct access to the esxi hosts, which would result in some security valnurabilities in our system, so that is not an option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could make import.vmdk work with Content Library, then upload would be to vCenter rather than ESX. When a vmdk is imported to CL, it will be converted, so datastore.cp target should also be thin.
Or if we added an option to import.{vmdk,ovf} to pullFromUrls , then vCenter would pull from the provided URL, rather than client uploading to ESX. Planning to do that for #3728
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a neat feature. Sadly it would complicate our workflow probably too much so I would prefer the first option.