-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[VMware] Sync the disk path or datastore changes for IDE disks, and before any volume resize during start vm (for the volumes on datastore cluster) #10748
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
base: 4.20
Are you sure you want to change the base?
Conversation
@blueorangutan package |
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10748 +/- ##
=========================================
Coverage 16.13% 16.13%
Complexity 13216 13216
=========================================
Files 5649 5649
Lines 496683 496684 +1
Branches 60176 60176
=========================================
+ Hits 80135 80139 +4
+ Misses 407625 407622 -3
Partials 8923 8923
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13097 |
@blueorangutan test ol8 vmware-7u3 |
@Pearl1594 [SL] unsupported parameters provided. Supported mgmt server os are: |
@blueorangutan test ol8 vmware-70u3 |
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-70u3) has been kicked to run smoke tests |
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.
@sureshanaparti Tested the pr, issue is still present
[SF] Trillian test result (tid-13070)
|
…nd before any resize during start vm (for the volumes on datastore cluster)
65bf768
to
b552d90
Compare
@blueorangutan package |
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13199 |
@blueorangutan test |
@kiranchavala a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
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.
LGTM
-
Have a Cloudstack environment with Vmware 8.0 and datastore cluster and vsphere storage drs enabled
-
Deploy a vm with a iso image
-
Stop the vm
-
Trigger a vsphere storage drs on one of the datastore cluster ( this can done filling up a datastore)
-
Start the vm > vm able to start
Logs
2025-04-29 07:33:14,967 INFO [c.c.h.v.m.BaseMO] (DirectAgent-240:[ctx-d7f4865e, 10.0.35.221, job-51/job-52, cmd: StartCommand]) (logid:976681f9) Looking for disk device info for volume [i-2-6-VM.vmdk] with base name [i-2-6-VM].
2025-04-29 07:33:14,967 INFO [c.c.h.v.m.BaseMO] (DirectAgent-240:[ctx-d7f4865e, 10.0.35.221, job-51/job-52, cmd: StartCommand]) (logid:976681f9) Testing if disk device with controller key [200] and unit number [1] has backing of type VirtualDiskFlatVer2BackingInfo.
2025-04-29 07:33:14,967 INFO [c.c.h.v.m.BaseMO] (DirectAgent-240:[ctx-d7f4865e, 10.0.35.221, job-51/job-52, cmd: StartCommand]) (logid:976681f9) Testing if backing datastore name [ds2] from backing [[ds2] i-2-6-VM/i-2-6-VM.vmdk] matches source datastore name [].
2025-04-29 07:33:14,967 INFO [c.c.h.v.m.BaseMO] (DirectAgent-240:[ctx-d7f4865e, 10.0.35.221, job-51/job-52, cmd: StartCommand]) (logid:976681f9) Disk backing [[ds2] i-2-6-VM/i-2-6-VM.vmdk] matches device bus name [ide0:1].
2025-04-29 07:33:15,179 INFO [c.c.h.v.r.VmwareResource] (DirectAgent-240:[ctx-d7f4865e, 10.0.35.221, job-51/job-52, cmd: StartCommand]) (logid:976681f9) Found existing disk info from volume path: i-2-6-VM
2025-04-29 07:33:18,997 DEBUG [c.c.h.v.r.VmwareResource] (DirectAgent-240:[ctx-d7f4865e, 10.0.35.221, job-51/job-52, cmd: StartCommand]) (logid:976681f9) VM i-2-6-VM has been started successfully with hostname i-2-6-VM.
2025-04-29 07:33:19,001 DEBUG [c.c.a.t.Request] (Work-Job-Executor-12:[ctx-c071f476, job-51/job-52, ctx-46c70ab3]) (logid:976681f9) Seq 1-6852789782997631226: Received: { Ans: , MgmtId: 32987496317188, via: 1(10.0.35.221), Ver: v1, Flags: 10, { StartAnswer } }
2025-04-29 07:33:19,025 INFO [o.a.c.e.o.VolumeOrchestrator] (Work-Job-Executor-12:[ctx-c071f476, job-51/job-52, ctx-46c70ab3]) (logid:976681f9) Updating volume's disk chain info. Volume: [{"name":"ROOT-6","uuid":"281e0a25-11fa-456e-b61b-aaeb2d086a80"}]. Path: [90e32def4fad4217a9590ac3434484e3] -> [i-2-6-VM], Disk Chain Info: [{"diskDeviceBusName":"ide0:1","diskChain":["[ds1] i-2-6-VM/90e32def4fad4217a9590ac3434484e3.vmdk"]}] -> [{"diskDeviceBusName":"ide0:1","diskChain":["[ds2] i-2-6-VM/i-2-6-VM.vmdk"]}].
2025-04-29 07:33:19,057 DEBUG [c.c.n.NetworkModelImpl] (Work-Job-Executor-12:[ctx-c071f476, job-51/job-52, ctx-46c70ab3]) (logid:976681f9) Service SecurityGroup is not supported in the network Network {"id": 204, "name": "test", "uuid": "f5c3bb0a-cf73-42a2-803b-fdd745cffc03", "networkofferingid": 10}
2025-04-29 07:33:19,060 DEBUG [c.c.n.NetworkModelImpl] (Work-Job-Executor-12:[ctx-c071f476, job-51/job-52, ctx-46c70ab3]) (logid:976681f9) Service SecurityGroup is not supported in the network Network {"id": 204, "name": "test", "uuid": "f5c3bb0a-cf73-42a2-803b-fdd745cffc03", "networkofferingid": 10}
2025-04-29 07:33:19,063 DEBUG [c.c.c.CapacityManagerImpl] (Work-Job-Executor-12:[ctx-c071f476, job-51/job-52, ctx-46c70ab3]) (logid:976681f9) VM instance {"id":6,"instanceName":"i-2-6-VM","state":"Running","type":"User","uuid":"3ee2497d-2ace-4c1e-9892-eb3f5a814490"} state transited from [Starting] to [Running] with event [OperationSucceeded]. VM's original host: Host {"id":1,"name":"10.0.35.221","type":"Routing","uuid":"33452dc5-9409-4124-80bf-1b409cfbdc7e"}, new host: Host {"id":1,"name":"10.0.35.221","type":"Routing","uuid":"33452dc5-9409-4124-80bf-1b409cfbdc7e"}, host before state transition: Host {"id":1,"name":"10.0.35.221","type":"Routing","uuid":"33452dc5-9409-4124-80bf-1b409cfbdc7e"}
2025-04-29 07:33:19,066 DEBUG [c.c.v.ClusteredVirtualMachineManagerImpl] (Work-Job-Executor-12:[ctx-c071f476, job-51/job-52, ctx-46c70ab3]) (logid:976681f9) Start completed for VM VM instance {"id":6,"instanceName":"i-2-6-VM","state":"Running","type":"User","uuid":"3ee2497d-2ace-4c1e-9892-eb3f5a814490"}
VirtualMachineDiskInfo matchingExistingDisk = getMatchingExistingDisk(diskInfoBuilder, vol, hyperHost, context); | ||
VolumeObjectTO volumeTO = (VolumeObjectTO) vol.getData(); | ||
DataStoreTO primaryStore = volumeTO.getDataStore(); | ||
Map<String, String> details = vol.getDetails(); | ||
boolean managed = false; | ||
String iScsiName = null; | ||
|
||
if (details != null) { | ||
managed = Boolean.parseBoolean(details.get(DiskTO.MANAGED)); | ||
iScsiName = details.get(DiskTO.IQN); | ||
} | ||
|
||
String primaryStoreUuid = primaryStore.getUuid(); | ||
// if the storage is managed, iScsiName should not be null | ||
String datastoreName = managed ? VmwareResource.getDatastoreName(iScsiName) : primaryStoreUuid; | ||
Pair<ManagedObjectReference, DatastoreMO> volumeDsDetails = dataStoresDetails.get(datastoreName); | ||
|
||
assert (volumeDsDetails != null); | ||
if (volumeDsDetails == null) { | ||
throw new Exception("Primary datastore " + primaryStore.getUuid() + " is not mounted on host."); | ||
} | ||
|
||
if (vol.getDetails().get(DiskTO.PROTOCOL_TYPE) != null && vol.getDetails().get(DiskTO.PROTOCOL_TYPE).equalsIgnoreCase("DatastoreCluster")) { | ||
if (diskInfoBuilder != null && matchingExistingDisk != null) { | ||
String[] diskChain = matchingExistingDisk.getDiskChain(); | ||
if (diskChain != null && diskChain.length > 0) { | ||
DatastoreFile file = new DatastoreFile(diskChain[0]); | ||
if (!file.getFileBaseName().equalsIgnoreCase(volumeTO.getPath())) { | ||
if (logger.isInfoEnabled()) | ||
logger.info("Detected disk-chain top file change on volume: " + volumeTO.getId() + " " + volumeTO.getPath() + " -> " + file.getFileBaseName()); | ||
volumeTO.setPath(file.getFileBaseName()); | ||
vol.setPath(file.getFileBaseName()); | ||
} | ||
} | ||
DatastoreMO diskDatastoreMofromVM = getDataStoreWhereDiskExists(hyperHost, context, diskInfoBuilder, vol, diskDatastores); | ||
if (diskDatastoreMofromVM != null) { | ||
String actualPoolUuid = diskDatastoreMofromVM.getCustomFieldValue(CustomFieldConstants.CLOUD_UUID); | ||
if (actualPoolUuid != null && !actualPoolUuid.equalsIgnoreCase(primaryStore.getUuid())) { | ||
volumeDsDetails = new Pair<>(diskDatastoreMofromVM.getMor(), diskDatastoreMofromVM); | ||
if (logger.isInfoEnabled()) | ||
logger.info("Detected datastore uuid change on volume: " + volumeTO.getId() + " " + primaryStore.getUuid() + " -> " + actualPoolUuid); | ||
((PrimaryDataStoreTO)primaryStore).setUuid(actualPoolUuid); | ||
} | ||
} | ||
} | ||
} |
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.
@sureshanaparti , can you extract these lines in extra methods?
[SF] Trillian test result (tid-13178)
|
Description
This PR syncs the disk path or datastore changes for IDE disks as well, and before any volume resize during start vm (for the volumes on datastore cluster pool) in VMware.
Fixes #10626
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tested VM (with ISO) start after storage drs triggered in datastore cluster for the ROOT volume.
How did you try to break this feature and the system with this change?