Skip to content
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

[BUG] l try to create vm and add disk with different datastore but do not happen #3407

Open
TAOTAO-WEB opened this issue Apr 10, 2024 · 4 comments

Comments

@TAOTAO-WEB
Copy link

l use govmomi to create the vm and try to add disk., but the disk use the datastore specify in types.VirtualMachineRelocateSpec not the types.VirtualDeviceFileBackingInfo->Datastore

	device := types.VirtualDisk{
				CapacityInKB: disks[idx].Cap * 1024 * 1024,
				VirtualDevice: types.VirtualDevice{
					Backing: &types.VirtualDiskFlatVer2BackingInfo{
						DiskMode:        string(types.VirtualDiskModePersistent),
						ThinProvisioned: types.NewBool(true),
						VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{
							Datastore: &storeCusInfo.Self,
						},
					},
				},
			}
deviceList.AssignController(&device, controller)
			addDeviceSpec := &types.VirtualDeviceConfigSpec{
				Operation:     types.VirtualDeviceConfigSpecOperationAdd,
				FileOperation: types.VirtualDeviceConfigSpecFileOperationCreate,
				Device:        &device,
			}

relocateSpec := types.VirtualMachineRelocateSpec{
		Folder:    &folderRef,
		Datastore: &storeInfo.Self,
		Pool:      &resRef,
	}
Copy link
Contributor

Howdy 🖐   TAOTAO-WEB ! Thank you for your interest in this project. We value your feedback and will respond soon.

If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION guidelines.

@TAOTAO-WEB
Copy link
Author

TAOTAO-WEB commented Apr 10, 2024 via email

Copy link
Contributor

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.

@TAOTAO-WEB
Copy link
Author

TAOTAO-WEB commented Jul 10, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant