mirror of https://github.com/apache/cloudstack.git
server: throw exception when update vm nic on L2 network (#4625)
without this change
```
root@mgt01:~# cmk update vmnicip nicid=afab73cb-f4f4-490f-a524-365edef432b7
{
"accountid": "a27bffc1-48ee-11eb-8680-069fc4003392",
"cmd": "org.apache.cloudstack.api.command.user.vm.UpdateVmNicIpCmd",
"completed": "2020-12-28T12:55:27+0000",
"created": "2020-12-28T12:55:27+0000",
"jobid": "88af30e0-214b-4379-9c39-49648f998ff6",
"jobprocstatus": 0,
"jobresult": {
"errorcode": 530,
"errortext": "Failed to update ip address on vm NIC. Refer to server logs for details."
},
"jobresultcode": 530,
"jobresulttype": "object",
"jobstatus": 2,
"userid": "a27f45f5-48ee-11eb-8680-069fc4003392"
}
🙈 Error: async API failed for job 88af30e0-214b-4379-9c39-49648f998ff6
```
with this change
```
root@mgt01:~# cmk update vmnicip nicid=22d79189-6754-4dfe-a8c4-0ba21be2ada5
{
"accountid": "044bb5a9-32fd-11eb-b251-06b6e80033a6",
"cmd": "org.apache.cloudstack.api.command.user.vm.UpdateVmNicIpCmd",
"completed": "2020-12-28T12:55:15+0000",
"created": "2020-12-28T12:55:15+0000",
"jobid": "f4ccb545-0e47-4e9c-b562-b0e6cf52ddd7",
"jobprocstatus": 0,
"jobresult": {
"errorcode": 431,
"errortext": "UpdateVmNicIpCmd is not supported in L2 network"
},
"jobresultcode": 530,
"jobresulttype": "object",
"jobstatus": 2,
"userid": "044cc6e3-32fd-11eb-b251-06b6e80033a6"
}
🙈 Error: async API failed for job f4ccb545-0e47-4e9c-b562-b0e6cf52ddd7
```
This commit is contained in:
parent
e4972c9981
commit
890e84777c
|
|
@ -1652,8 +1652,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
|||
return null;
|
||||
}
|
||||
} else {
|
||||
s_logger.error("UpdateVmNicIpCmd is not supported in this network...");
|
||||
return null;
|
||||
throw new InvalidParameterValueException("UpdateVmNicIpCmd is not supported in L2 network");
|
||||
}
|
||||
|
||||
s_logger.debug("Updating IPv4 address of NIC " + nicVO + " to " + ipaddr + "/" + nicVO.getIPv4Netmask() + " with gateway " + nicVO.getIPv4Gateway());
|
||||
|
|
|
|||
Loading…
Reference in New Issue