shwstppr commented on PR #8488:
URL: https://github.com/apache/cloudstack/pull/8488#issuecomment-1886966407
Tested this. Import works fine but volume size is returned as 0 for imported
VM with smaller size volumes.
listUnmanagedInstances output,
```
{
"listunmanagedinstancesresponse": {
"count": 1,
"unmanagedinstance": [
{
"name": "i-2-36-VM",
"clusterid": "4c948570-9ceb-465a-829a-88eb777ce13f",
"clustername": "p1-c2",
"hostid": "9d1e614a-b9b6-4b57-8df5-8dd49a2501f3",
"hostname": "ref-trl-5272-v-mr8-abhishek-kumar-kvm1",
"powerstate": "PowerOn",
"cpunumber": 1,
"cpucorepersocket": -1,
"cpuspeed": 250,
"memory": 512,
"disk": [
{
"id": "0",
"label": "hda",
"capacity": 52428800,
"imagepath":
"/mnt/ef4f8bb2-c104-30cc-a3a2-087548c11d6f/3447c0bb-1961-4bb0-bcb3-2e06c7d35c9b",
"controller": "ide",
"position": 0,
"datastorename":
"/acs/primary/ref-trl-5272-v-Mr8-abhishek-kumar/ref-trl-5272-v-Mr8-abhishek-kumar-kvm-pri1",
"datastorehost": "10.1.32.4",
"datastorepath":
"/acs/primary/ref-trl-5272-v-Mr8-abhishek-kumar/ref-trl-5272-v-Mr8-abhishek-kumar-kvm-pri1",
"datastoretype": "file"
}
],
"nic": [
{
"id": "0",
"networkname": "vnet0",
"macaddress": "02:01:00:cd:00:05",
"vlanid": -1,
"adaptertype": "e1000"
}
]
}
]
}
}
```
Import called with params,
```
name=i-2-36-VM&clusterid=4c948570-9ceb-465a-829a-88eb777ce13f&displayname=test&zoneid=b4a732bb-e837-4682-bbb9-b845b04a17dd&importsource=unmanaged&hypervisor=kvm&host=&username=&password=&diskpath=&temppath=&serviceofferingid=cec984be-1c57-468b-b1b1-94ea3cef705e&templateid=9e2ebcc2-d325-456e-8cad-1e1485e32d6a&nicnetworklist[0].nic=0&nicnetworklist[0].network=074dd540-2414-4ce2-9a51-f1888b8839c4
```
Template used in Macchinina
ListVM output for the imported VM,
```
{
"listvirtualmachinesmetricsresponse": {
"count": 1,
"virtualmachine": [
{
"cputotal": "0.5 Ghz",
"memorytotal": "0.50 GiB",
"networkread": "0.01 MiB",
"networkwrite": "0.00 MiB",
"diskread": "0.00 MiB",
"diskwrite": "0.00 MiB",
"diskiopstotal": 0,
"id": "62f777a5-9dbb-472f-b70b-a2635bbaa2f0",
"name": "test",
"displayname": "test",
"account": "admin",
"userid": "c77dbaa7-af98-11ee-847d-1e0058000a5d",
"username": "admin",
"domainid": "a2138f1e-af98-11ee-847d-1e0058000a5d",
"domain": "ROOT",
"created": "2024-01-11T11:43:01+0000",
"state": "Running",
"haenable": false,
"zoneid": "b4a732bb-e837-4682-bbb9-b845b04a17dd",
"zonename": "ref-trl-5272-v-Mr8-abhishek-kumar",
"hostid": "9d1e614a-b9b6-4b57-8df5-8dd49a2501f3",
"hostname": "ref-trl-5272-v-mr8-abhishek-kumar-kvm1",
"hostcontrolstate": "Enabled",
"templateid": "9e2ebcc2-d325-456e-8cad-1e1485e32d6a",
"templatename": "macc-kvm",
"templatetype": "USER",
"templatedisplaytext": "macc-kvm",
"passwordenabled": false,
"serviceofferingid": "cec984be-1c57-468b-b1b1-94ea3cef705e",
"serviceofferingname": "Small Instance",
"cpunumber": 1,
"cpuspeed": 500,
"memory": 512,
"cpuused": "3.17%",
"networkkbsread": 7,
"networkkbswrite": 0,
"diskkbsread": 0,
"diskkbswrite": 0,
"memorykbs": 524288,
"memoryintfreekbs": -1,
"memorytargetkbs": 524288,
"diskioread": 0,
"diskiowrite": 0,
"guestosid": "a23b8c54-af98-11ee-847d-1e0058000a5d",
"rootdeviceid": 0,
"rootdevicetype": "ROOT",
"securitygroup": [],
"nic": [
{
"id": "947586e0-5c81-4a1f-980c-60ba6f0ae4ff",
"networkid": "074dd540-2414-4ce2-9a51-f1888b8839c4",
"networkname": "testL2",
"isolationuri": "vlan://1760",
"broadcasturi": "vlan://1760",
"traffictype": "Guest",
"type": "L2",
"isdefault": true,
"macaddress": "02:01:00:cd:00:05",
"secondaryip": [],
"extradhcpoption": [],
"deviceid": "0"
}
],
"hypervisor": "KVM",
"instancename": "i-2-36-VM",
"details": {
"deployvm": "true",
"kvm.vnc.password": "lqU9pMsfaaaaaaaaaaaaaa",
"rootdisksize": "1",
"nicAdapter": "e1000",
"rootDiskController": "ide"
},
"affinitygroup": [],
"displayvm": true,
"isdynamicallyscalable": false,
"ostypeid": "a23b8c54-af98-11ee-847d-1e0058000a5d",
"osdisplayname": "Other Linux (64-bit)",
"pooltype": "NetworkFilesystem",
"receivedbytes": 0,
"sentbytes": 0,
"tags": [],
"hasannotations": false
}
]
}
}
```
List volumes output for the VM volume,
```
{
"listvolumesresponse": {
"count": 1,
"volume": [
{
"sizegb": "0.00 GiB",
"id": "c888227f-6676-487c-9625-b09e199abdb3",
"name": "ROOT-39",
"zoneid": "b4a732bb-e837-4682-bbb9-b845b04a17dd",
"zonename": "ref-trl-5272-v-Mr8-abhishek-kumar",
"type": "ROOT",
"deviceid": 0,
"virtualmachineid": "62f777a5-9dbb-472f-b70b-a2635bbaa2f0",
"templateid": "9e2ebcc2-d325-456e-8cad-1e1485e32d6a",
"templatename": "macc-kvm",
"templatedisplaytext": "macc-kvm",
"vmname": "test",
"vmdisplayname": "test",
"vmstate": "Running",
"vmtype": "User",
"provisioningtype": "thin",
"size": 0,
"created": "2024-01-11T11:43:01+0000",
"state": "Ready",
"account": "admin",
"domainid": "a2138f1e-af98-11ee-847d-1e0058000a5d",
"domain": "ROOT",
"storagetype": "Shared (ROOT)",
"hypervisor": "KVM",
"storage": "ref-trl-5272-v-Mr8-abhishek-kumar-kvm-pri1",
"attached": "2024-01-11T11:43:01+0000",
"serviceofferingid": "1",
"serviceofferingname": "Small Instance",
"serviceofferingdisplaytext": "Small Instance",
"isextractable": false,
"displayvolume": true,
"path":
"/mnt/ef4f8bb2-c104-30cc-a3a2-087548c11d6f/3447c0bb-1961-4bb0-bcb3-2e06c7d35c9b",
"storageid": "ef4f8bb2-c104-30cc-a3a2-087548c11d6f",
"quiescevm": false,
"supportsstoragesnapshot": false,
"physicalsize": 1052672,
"virtualsize": 52428800,
"utilization": "2.0%",
"clusterid": "4c948570-9ceb-465a-829a-88eb777ce13f",
"clustername": "p1-c2",
"podid": "639ef97b-fa03-4de1-8d55-c262234fc033",
"podname": "Pod1",
"tags": [],
"hasannotations": false
}
]
}
}
```
--
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]