weizhouapache commented on code in PR #9731:
URL: https://github.com/apache/cloudstack/pull/9731#discussion_r1778114775


##########
ui/src/views/compute/EditVM.vue:
##########
@@ -289,15 +290,35 @@ export default {
       return decodedData.toString('utf-8')
     },
     fetchUserData () {
-      const params = {
-        id: this.resource.id,
-        userdata: true
+      let networkId
+      this.resource.nic.forEach(nic => {
+        if (nic.isdefault) {
+          networkId = nic.networkid
+        }
+      })
+      if (!networkId) {
+        return
+      }
+      const listNetworkParams = {
+        id: networkId

Review Comment:
   Hi @FelipeM525 
   if the caller (for example root admin) is different as the network owner 
(for example regular user), then `listall=true` is needed
   
   
   see an example below
   ```
   (testadmin) 🐱 > list networks id=69a230d7-1534-4cc9-b791-b98fdc2a845e 
filter=name
   (testadmin) 🐱 > 
   (testadmin) 🐱 > 
   (testadmin) 🐱 > list networks id=69a230d7-1534-4cc9-b791-b98fdc2a845e 
filter=name listall=true
   {
     "count": 1,
     "network": [
       {
         "name": "testadmin-003"
       }
     ]
   }
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to