diff --git a/ui/scripts/cloud.core.network.js b/ui/scripts/cloud.core.network.js
index e8c33f91057..7c5f27663ec 100644
--- a/ui/scripts/cloud.core.network.js
+++ b/ui/scripts/cloud.core.network.js
@@ -384,8 +384,10 @@ function showNetworkingTab(p_domainId, p_account) {
var vmSelect = createPortForwardingRow.find("#vm").empty();
if (instances != null && instances.length > 0) {
for (var i = 0; i < instances.length; i++) {
- var html = $("");
- vmSelect.append(html);
+ if (instances[i].state != 'Destroyed' && instances[i].state != 'Error' && instances[i].state != 'Creating') {
+ var html = $("");
+ vmSelect.append(html);
+ }
}
}
}
@@ -418,9 +420,11 @@ function showNetworkingTab(p_domainId, p_account) {
var instances = json.listvirtualmachinesresponse.virtualmachine;
var vmSelect = template.find("#row_container_edit #vm").empty();
if (instances != null && instances.length > 0) {
- for (var i = 0; i < instances.length; i++) {
- var html = $("");
- vmSelect.append(html);
+ for (var i = 0; i < instances.length; i++) {
+ if (instances[i].state != 'Destroyed' && instances[i].state != 'Error' && instances[i].state != 'Creating') {
+ var html = $("");
+ vmSelect.append(html);
+ }
}
vmSelect.val(virtualMachineId);
}