You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/07/20 15:30:43 UTC
[GitHub] [cloudstack] ravening opened a new pull request #5227: Store Vm migration details in db
ravening opened a new pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227
### Description
Currently its difficult to get the history of vm migrations
across the hosts if it has migrated several times in the past.
So store every migration entry in database so that it will be
easy for admins to track the migration of a particular vm across
different hosts.
<!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
<!-- Fixes: # -->
<!--- ********************************************************************************* -->
<!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
<!--- ********************************************************************************* -->
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [X] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [X] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to -->
<!-- see how your change affects other areas of the code, etc. -->
```
mysql> select * from vm_migration;
+----+-----------+-------------+---------------+-------------------------------------+--------------------+-------------+------------------+---------------------+-----------+------------+-----------+
| id | state | instance_id | instance_name | description | vm_type | source_host | destination_host | created | user_name | account_id | domain_id |
+----+-----------+-------------+---------------+-------------------------------------+--------------------+-------------+------------------+---------------------+-----------+------------+-----------+
| 1 | Started | 56 | i-2-56-VM | Starting migration of vm i-2-56-VM | User | node85 | node84 | 2021-07-20 11:27:17 | admin | 2 | 1 |
| 3 | Completed | 56 | i-2-56-VM | Completed migration of vm i-2-56-VM | User | node85 | node84 | 2021-07-20 11:27:35 | admin | 2 | 1 |
| 52 | Completed | 66 | r-66-VM | Completed migration of vm r-66-VM | DomainRouter | node84 | node85 | 2021-07-20 13:39:22 | admin | 2 | 1 |
| 50 | Completed | 2 | s-2-VM | Completed migration of vm s-2-VM | SecondaryStorageVm | node85 | node84 | 2021-07-20 13:39:15 | admin | 2 | 1 |
```
<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] rhtyd commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-909028042
Hi @ravening can you share the use of this feature? Can't we reuse/extend the events table/feature which keep tracks of most async jobs/apis?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-909087024
> Hi @ravening can you share the use of this feature? Can't we reuse/extend the events table/feature which keep tracks of most async jobs/apis?
@rhtyd use case is get better details related to vm migration as most of the vm migration data cant be easily obtained from event description
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-890820939
@blueorangutan test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] shwstppr commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
shwstppr commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-890771204
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on a change in pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#discussion_r689684461
##########
File path: engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -2580,15 +2585,51 @@ private void removeStaleVmFromSource(VMInstanceVO vm, HostVO srcHost) {
}
}
+ private void createRecord(VMInstanceVO vmInstance,
+ Account caller,
+ String srcHost,
+ String dstHost,
+ VmMigrationEvent.State state,
+ String description) {
+ VmMigrationVO vmMigrationVO = new VmMigrationVO(state,
+ vmInstance.getInstanceName(),
+ vmInstance.getId(),
+ description,
+ vmInstance.getType().toString(),
+ srcHost,
+ dstHost,
+ new Date(),
+ caller.getAccountName(),
+ caller.getAccountId(),
+ caller.getDomainId());
+
+ _vmMigrationDao.persist(vmMigrationVO);
+ }
+
+ private void initVmMigrateRecord(VMInstanceVO vmInstance, Account caller, String srcHost, String dstHost) {
+ String description = "Starting migration of vm " + vmInstance.instanceName;
Review comment:
We could use String.format here.
##########
File path: engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -2636,7 +2682,8 @@ private void orchestrateMigrate(final String vmUuid, final long srcHostId, final
}
protected void migrate(final VMInstanceVO vm, final long srcHostId, final DeployDestination dest) throws ResourceUnavailableException, ConcurrentOperationException {
- s_logger.info("Migrating " + vm + " to " + dest);
+ s_logger.info("Migrating " + vm + " to " + dest + " from source host id : " + srcHostId);
Review comment:
We could use String.format here.
##########
File path: api/src/main/java/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
##########
@@ -120,13 +120,22 @@ public String getEventType() {
@Override
public String getEventDescription() {
String eventDescription;
+ Long sourceHostId = 0L;
+
+ UserVm userVm = _entityMgr.findById(UserVm.class, getVirtualMachineId());
+ if (userVm != null) {
+ sourceHostId = userVm.getHostId();
+ }
if (getHostId() != null) {
eventDescription = String.format("Attempting to migrate VM id: %s to host Id: %s", getVirtualMachineId(), getHostId());
} else if (getStoragePoolId() != null) {
eventDescription = String.format("Attempting to migrate VM id: %s to storage pool Id: %s", getVirtualMachineId(), getStoragePoolId());
} else {
eventDescription = String.format("Attempting to migrate VM id: %s", getVirtualMachineId());
}
+ if (sourceHostId != 0L) {
+ eventDescription = eventDescription + " from host id: " + sourceHostId;
Review comment:
We could use `String.format` here.
##########
File path: engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -2580,15 +2585,51 @@ private void removeStaleVmFromSource(VMInstanceVO vm, HostVO srcHost) {
}
}
+ private void createRecord(VMInstanceVO vmInstance,
+ Account caller,
+ String srcHost,
+ String dstHost,
+ VmMigrationEvent.State state,
+ String description) {
+ VmMigrationVO vmMigrationVO = new VmMigrationVO(state,
+ vmInstance.getInstanceName(),
+ vmInstance.getId(),
+ description,
+ vmInstance.getType().toString(),
+ srcHost,
+ dstHost,
+ new Date(),
+ caller.getAccountName(),
+ caller.getAccountId(),
+ caller.getDomainId());
+
+ _vmMigrationDao.persist(vmMigrationVO);
+ }
+
+ private void initVmMigrateRecord(VMInstanceVO vmInstance, Account caller, String srcHost, String dstHost) {
+ String description = "Starting migration of vm " + vmInstance.instanceName;
+ createRecord(vmInstance, caller, srcHost, dstHost, VmMigrationEvent.State.Started, description);
+ }
+
+ private void completeVmMigrateRecord(VMInstanceVO vmInstance, Account caller, String srcHost, String dstHost) {
+ String description = "Completed migration of vm " + vmInstance.instanceName;
+ createRecord(vmInstance, caller, srcHost, dstHost, VmMigrationEvent.State.Completed, description);
+ }
+
+ private void failedVmMigrateRecord(VMInstanceVO vmInstance, Account caller, String srcHost, String dstHost) {
+ String description = "Unable to migrate the vm " + vmInstance.instanceName;
Review comment:
We could use String.format here.
##########
File path: engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -2580,15 +2585,51 @@ private void removeStaleVmFromSource(VMInstanceVO vm, HostVO srcHost) {
}
}
+ private void createRecord(VMInstanceVO vmInstance,
+ Account caller,
+ String srcHost,
+ String dstHost,
+ VmMigrationEvent.State state,
+ String description) {
+ VmMigrationVO vmMigrationVO = new VmMigrationVO(state,
+ vmInstance.getInstanceName(),
+ vmInstance.getId(),
+ description,
+ vmInstance.getType().toString(),
+ srcHost,
+ dstHost,
+ new Date(),
+ caller.getAccountName(),
+ caller.getAccountId(),
+ caller.getDomainId());
+
+ _vmMigrationDao.persist(vmMigrationVO);
+ }
+
+ private void initVmMigrateRecord(VMInstanceVO vmInstance, Account caller, String srcHost, String dstHost) {
+ String description = "Starting migration of vm " + vmInstance.instanceName;
+ createRecord(vmInstance, caller, srcHost, dstHost, VmMigrationEvent.State.Started, description);
+ }
+
+ private void completeVmMigrateRecord(VMInstanceVO vmInstance, Account caller, String srcHost, String dstHost) {
+ String description = "Completed migration of vm " + vmInstance.instanceName;
Review comment:
We could use String.format here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] harikrishna-patnala edited a comment on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
harikrishna-patnala edited a comment on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-884658092
Not to object this PR but I'm trying to understand here. We already have generic action events right to keep track of the operations. Also, the migrate VM event description has all the details when the operation is performed.
```
public String getEventDescription() {
String eventDescription;
if (getHostId() != null) {
eventDescription = String.format("Attempting to migrate VM id: %s to host Id: %s", getVirtualMachineId(), getHostId());
} else if (getStoragePoolId() != null) {
eventDescription = String.format("Attempting to migrate VM id: %s to storage pool Id: %s", getVirtualMachineId(), getStoragePoolId());
} else {
eventDescription = String.format("Attempting to migrate VM id: %s", getVirtualMachineId());
}
return eventDescription;
}
```
Please correct me if anything I'm missing here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] blueorangutan commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-890821623
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] harikrishna-patnala edited a comment on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
harikrishna-patnala edited a comment on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-884658092
Not to object this PR but I'm trying to understand here. We already have generic action events right to keep track of the operations. Also, the migrate VM event description has all the details when the operation is performed.
```
public String getEventDescription() {
String eventDescription;
if (getHostId() != null) {
eventDescription = String.format("Attempting to migrate VM id: %s to host Id: %s", getVirtualMachineId(), getHostId());
} else if (getStoragePoolId() != null) {
eventDescription = String.format("Attempting to migrate VM id: %s to storage pool Id: %s", getVirtualMachineId(), getStoragePoolId());
} else {
eventDescription = String.format("Attempting to migrate VM id: %s", getVirtualMachineId());
}
return eventDescription;
}
```
Please correct me if anything I'm missing here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-895183913
> @ravening sorry for not being able to understand but how this will help admins against adding source host details for event entries?
> Even with changes admin will have to use SQL query. Similar details can be fetched using `event` table as well and changes can be made to add source host in the event description:
>
> ```
> > SELECT * FROM event WHERE description LIKE '%VM Id: 104%' AND type='VM.MIGRATE' ORDER BY id DESC\G
> *************************** 1. row ***************************
> id: 7114
> uuid: 0a63c788-7ee9-4612-81ad-57c45bc0d54c
> type: VM.MIGRATE
> state: Completed
> description: Successfully completed migrating VM. VM Id: 104 to host Id: 2
> user_id: 2
> account_id: 2
> domain_id: 1
> created: 2021-08-02 07:11:41
> level: INFO
> start_id: 7112
> parameters: NULL
> archived: 0
> display: 1
> *************************** 2. row ***************************
> id: 7113
> uuid: 0b23a367-2187-4415-a7c9-624b8e956733
> type: VM.MIGRATE
> state: Started
> description: migrating VM. VM Id: 104 to host Id: 2
> user_id: 2
> account_id: 2
> domain_id: 1
> created: 2021-08-02 07:11:27
> level: INFO
> start_id: 7112
> parameters: NULL
> archived: 0
> display: 1
> *************************** 3. row ***************************
> id: 7112
> uuid: 98c658eb-5fed-4f27-b94b-cac85c9e612a
> type: VM.MIGRATE
> state: Scheduled
> description: Attempting to migrate VM id: 104 to host Id: 2
> user_id: 2
> account_id: 2
> domain_id: 1
> created: 2021-08-02 07:11:27
> level: INFO
> start_id: 0
> parameters: NULL
> archived: 0
> display: 1
> ```
>
> Also, why names of hosts and IDs?
@shwstppr
```
*************************** 24. row ***************************
id: 24
state: Completed
instance_id: 17
instance_name: i-2-17-VM
description: Completed migration of vm i-2-17-VM
vm_type: User
source_host: node42
destination_host: node41
created: 2021-07-20 15:31:07
user_name: admin
account_id: 2
domain_id: 1
```
Im adding a new table `vm_migration` which has fewer details related to migration of vm which can be easily using instance_name, search for only failed migrations. search for all migrations related to a particular host.
I know it can be obtained from either events table or from listEvents api but the information available there is not easy to read.
This will make getting data easier but if you guys think that this feature is not needed then I can close this pr.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-909087024
> Hi @ravening can you share the use of this feature? Can't we reuse/extend the events table/feature which keep tracks of most async jobs/apis?
@rhtyd use case is get better details related to vm migration as most of the vm migration data cant be easily obtained from event description
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] blueorangutan commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-890771588
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-909087024
> Hi @ravening can you share the use of this feature? Can't we reuse/extend the events table/feature which keep tracks of most async jobs/apis?
@rhtyd use case is get better details related to vm migration as most of the vm migration data cant be easily obtained from event description
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] blueorangutan commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-891331835
<b>Trillian test result (tid-1447)</b>
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 44327 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5227-t1447-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Smoke tests completed. 88 look OK, 1 have error(s)
Only failed tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 529.67 | test_vpc_redundant.py
test_05_rvpc_multi_tiers | `Failure` | 507.38 | test_vpc_redundant.py
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-884705553
> > > this needs extensive testing across all hypervisors I'm afraid. Better not to have data than faulty data.
> > > @borisstoyanov do you see chance to address this?
> >
> >
> > @DaanHoogland its just storing the source host and the destination host. what faulty data are you talking about?
>
> for instance no data for an out of band migration (on vmware for instance) and other things we don;t think of now.
@DaanHoogland good point. In that case I can add a check for hypervisor type. If its kvm then store the entry. Later it can be extended to support different hypervisors
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-884034679
> this needs extensive testing across all hypervisors I'm afraid. Better not to have data than faulty data.
> @borisstoyanov do you see chance to address this?
@DaanHoogland its just storing the source host and the destination host. what faulty data are you talking about?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-884255410
> > this needs extensive testing across all hypervisors I'm afraid. Better not to have data than faulty data.
> > @borisstoyanov do you see chance to address this?
>
> @DaanHoogland its just storing the source host and the destination host. what faulty data are you talking about?
for instance no data for an out of band migration (on vmware for instance) and other things we don;t think of now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-884704490
> Not to object this PR but I'm trying to understand here. We already have generic action events right to keep track of the operations. Also, the migrate VM event description has all the details when the operation is performed.
>
> ```
> public String getEventDescription() {
> String eventDescription;
> if (getHostId() != null) {
> eventDescription = String.format("Attempting to migrate VM id: %s to host Id: %s", getVirtualMachineId(), getHostId());
> } else if (getStoragePoolId() != null) {
> eventDescription = String.format("Attempting to migrate VM id: %s to storage pool Id: %s", getVirtualMachineId(), getStoragePoolId());
> } else {
> eventDescription = String.format("Attempting to migrate VM id: %s", getVirtualMachineId());
> }
> return eventDescription;
> }
> ```
>
> Please correct me if anything I'm missing here.
@harikrishna-patnala yes we do have that.. I made code change in the getEventDescription to display source host also. If I want to get the migration details of a particular vm then its difficult to get using listEvents api. If we have stored that in db, then I can fetch using instance name or instance type also.
Also the details displayed in listEvents api for VM.MIGRATE event is not so user friendly
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-933162446
Hi @ravening, I really appreciate your work here but I'm also sorry again this is really not to object the PR. If you still think there is something we can fix here please start a discussion on dev mailing list that may help. Otherwise, as you mentioned please close the PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-930007566
@rhtyd @shwstppr @harikrishna-patnala shall i close this pr considering I didnt get enough votes to continue with this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-930007566
@rhtyd @shwstppr @harikrishna-patnala shall i close this pr considering I didnt get enough votes to continue with this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] shwstppr commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
shwstppr commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-895321755
@ravening I'm not against it. Though I'm not sure if having source and destination host detail will help a lot to operators in cases of failures. Maybe people with that kind of experience can comment.
Also, will it make sense to explore using View instead of a new table?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] shwstppr commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
shwstppr commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-890793820
@ravening sorry for not being able to understand but how this will help admins against adding source host details for event entries?
Even with changes admin will have to use SQL query. Similar details can be fetched using `event` table as well and changes can be made to add source host in the event description:
```
> SELECT * FROM event WHERE description LIKE '%VM Id: 104%' AND type='VM.MIGRATE' ORDER BY id DESC\G
*************************** 1. row ***************************
id: 7114
uuid: 0a63c788-7ee9-4612-81ad-57c45bc0d54c
type: VM.MIGRATE
state: Completed
description: Successfully completed migrating VM. VM Id: 104 to host Id: 2
user_id: 2
account_id: 2
domain_id: 1
created: 2021-08-02 07:11:41
level: INFO
start_id: 7112
parameters: NULL
archived: 0
display: 1
*************************** 2. row ***************************
id: 7113
uuid: 0b23a367-2187-4415-a7c9-624b8e956733
type: VM.MIGRATE
state: Started
description: migrating VM. VM Id: 104 to host Id: 2
user_id: 2
account_id: 2
domain_id: 1
created: 2021-08-02 07:11:27
level: INFO
start_id: 7112
parameters: NULL
archived: 0
display: 1
*************************** 3. row ***************************
id: 7112
uuid: 98c658eb-5fed-4f27-b94b-cac85c9e612a
type: VM.MIGRATE
state: Scheduled
description: Attempting to migrate VM id: 104 to host Id: 2
user_id: 2
account_id: 2
domain_id: 1
created: 2021-08-02 07:11:27
level: INFO
start_id: 0
parameters: NULL
archived: 0
display: 1
```
Also, why names of hosts and IDs?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] DaanHoogland commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-883986044
this needs extensive testing across all hypervisors I'm afraid. Better not to have data than faulty data.
@borisstoyanov do you see chance to address this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] rhtyd commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-909028042
Hi @ravening can you share the use of this feature? Can't we reuse/extend the events table/feature which keep tracks of most async jobs/apis?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-887263461
@rhtyd @ustcweizhou any opinion on this pr?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-895806233
> @ravening I'm not against it. Though I'm not sure if having source and destination host detail will help a lot to operators in cases of failures. Maybe people with that kind of experience can comment.
> Also, will it make sense to explore using View instead of a new table?
@shwstppr but view has to fetch/join some tables right to get this data? this type of data is not stored in any other table.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] rhtyd commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-909028042
Hi @ravening can you share the use of this feature? Can't we reuse/extend the events table/feature which keep tracks of most async jobs/apis?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-885412965
@ravening thanks for explaining and I agree this adds some user friendliness but my main concern is, this looks more like fixing a single usecase. If we have to think of all other APIs or operations each operation can also be tracked separately in different tables and this approach adds more tables. I rather prefer to track via action events.
Let's hear others opinions too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] harikrishna-patnala commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
harikrishna-patnala commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-884658092
Not to object this PR but I'm trying to understand here. We already have generic action events right to keep track of the operations. Also, the migrate VM event description has all the details when the operation is performed.
```
public String getEventDescription() {
String eventDescription;
if (getHostId() != null) {
eventDescription = String.format("Attempting to migrate VM id: %s to host Id: %s", getVirtualMachineId(), getHostId());
} else if (getStoragePoolId() != null) {
eventDescription = String.format("Attempting to migrate VM id: %s to storage pool Id: %s", getVirtualMachineId(), getStoragePoolId());
} else {
eventDescription = String.format("Attempting to migrate VM id: %s", getVirtualMachineId());
}
return eventDescription;
}
```
Please correct me if anything I'm missing here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] ravening closed pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
ravening closed pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] blueorangutan commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-890806449
Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 724
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] rhtyd commented on pull request #5227: Store Vm migration details in db
Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5227:
URL: https://github.com/apache/cloudstack/pull/5227#issuecomment-889639116
Hi @ravening I'll get back to you soon, I've pinged @shwstppr to review if he's got time. cc @nvazquez
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org