threefoldtecharchive / jumpscale9_lib

Apache License 2.0
0 stars 1 forks source link

Deploy vm on farm node raise error #139

Closed Dinaamagdy closed 5 years ago

Dinaamagdy commented 5 years ago

Steps

Error

ResultError: "failed to create machine: virError(Code=8, Domain=44, Message='invalid argument: could not find capabilities for arch=x86_64 domaintype=kvm ')

zaibon commented 5 years ago

@Dinaamagdy need way more input. What farm, what node ? The error says that the node doesn't support virtualization, which makes me think this is a farmer with some exotic hardware and that something needs to be done in the bios

0xIslamTaha commented 5 years ago

@zaibon faced the same issue with one of kds-farm node

In [5]: node = j.clients.zos.get('e0d55e6af8cd', data={'host':'10.102.132.23'})

In [6]: node.client.ping()
Out[6]: 'PONG Version: development @Revision: bdb63e7c3088a6126b12fc1af0dfb0a8c9363594'

In [7]: vm = node.primitives.create_virtual_machine('xTremX_vm_1', 'ubuntu:latest')

In [8]: key = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjPfKUsaFuaGJsnHvF3k0PbqQTr3GL2pNuddn/xQjs
   ...: roF35ELJVEovAsd9IlsFWOmDWlL6B+JYFgj8g5IykklHCDfmTu6LcGXjdfAYVp+eXARmgoCJKxVyenSVHu6No9O
   ...: 1e+QKFvMJTiJXdl08fZD1Fd2kRetDRKAijCZ76pmB4/KwVFiJKCVVdsDW/0R+td0gNVJyCQyRTcWEPmBfGMW/Jr
   ...: vRCSHfxlLdqsD3txLOm9pHlQ/LmEwOP3bqEEpQU1jP32JbdAdreuD6BYB+YRp02yyU33gd1QbqIEgftcN+6TuZJ
   ...: OU3j2VRSiUQX8h5SjtWV1UXE15ELlIlhcFJYH6L root@islamtaha-TT'

In [9]: vm.configs.add('mysshkey', '/root/.ssh/authorized_keys', key)
Out[9]: Config <mysshkey:/root/.ssh/authorized_keys>

In [12]: j.clients.zerotier.list()
Out[12]: ['9821c424de']

In [13]: zt_client = j.clients.zerotier.get('9821c424de')

In [14]: zt_nw = zt_client.network_get('af78bf9436aebe54')

In [15]: vm.nics.add_zerotier(network=zt_nw)
Out[15]: ZTNic <compassionate_metcalfe:zerotier:af78bf9436aebe54>

In [16]: vm.deploy()
---------------------------------------------------------------------------
ResultError                               Traceback (most recent call last)
/usr/local/bin/js_shell in <module>()
----> 1 vm.deploy()

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/sal_zos/vm/ZOS_VM.py in deploy(self)
    493     def deploy(self):
    494         if not self.is_running():
--> 495             self.start()
    496         else:
    497             # search for diskchanges

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/sal_zos/vm/ZOS_VM.py in start(self)
    382             j.sal_zos.utils.authorize_zerotiers(publiczt, self.nics)
    383         self.node.client.kvm.create(self.name, media, self.flist, self.vcpus,
--> 384                                     self.memory, nics, ports, mounts, self.tags, config)
    385 
    386     def load_from_reality(self):

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/clients/zero_os_protocol/KvmManager.py in create(self, name, media, flist, cpu, memory, nics, port, mount, tags, config, storage, cmdline, share_cache)
    227             raise ValueError('need at least one boot media via media or an flist')
    228 
--> 229         return self._client.json('kvm.create', args, tags=tags)
    230 
    231     def prepare_migration_target(self, uuid, nics=None, port=None, tags=None):

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/clients/zero_os_protocol/BaseClient.py in json(self, command, arguments, tags, id)
    123         :Return: Data
    124         """
--> 125         result = self.sync(command, arguments, tags=tags, id=id)
    126         if result.level != 20:
    127             raise RuntimeError('invalid result level, expecting json(20) got (%d)' % result.level)

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/clients/zero_os_protocol/BaseClient.py in sync(self, command, arguments, tags, id)
    113             if not result.code:
    114                 result._code = 500
--> 115             raise ResultError(msg='%s' % result.data, code=result.code)
    116 
    117         return result

ResultError: "failed to create machine: virError(Code=8, Domain=44, Message='invalid argument: could not find capabilities for arch=x86_64 domaintype=kvm ')"

In [17]: vm.to_dict()
Out[17]: 
{'configs': [{'content': 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjPfKUsaFuaGJsnHvF3k0PbqQTr3GL2pNuddn/xQjsroF35ELJVEovAsd9IlsFWOmDWlL6B+JYFgj8g5IykklHCDfmTu6LcGXjdfAYVp+eXARmgoCJKxVyenSVHu6No9O1e+QKFvMJTiJXdl08fZD1Fd2kRetDRKAijCZ76pmB4/KwVFiJKCVVdsDW/0R+td0gNVJyCQyRTcWEPmBfGMW/JrvRCSHfxlLdqsD3txLOm9pHlQ/LmEwOP3bqEEpQU1jP32JbdAdreuD6BYB+YRp02yyU33gd1QbqIEgftcN+6TuZJOU3j2VRSiUQX8h5SjtWV1UXE15ELlIlhcFJYH6L root@islamtaha-TT',
   'path': '/root/.ssh/authorized_keys'}],
 'cpu': 2,
 'disks': [],
 'flist': 'https://hub.grid.tf/tf-bootable/ubuntu:latest.flist',
 'memory': 2048,
 'mounts': [],
 'name': 'xTremX_vm_1',
 'nics': [{'id': 'af78bf9436aebe54',
   'name': 'compassionate_metcalfe',
   'type': 'zerotier',
   'ztClient': '9821c424de'}],
 'ports': [],
 'tags': [],
 'ztIdentity': 'd30425f10e:0:cb3b2b52ab01c65cb5153ed7d0118fa2b453c733647f84fbc8cb814a6686881f76c49ca92b900cda0802f6ab9e86145a81dc637638e2051f87a044558c709ea7:565f2b2e4ce74cbe1256ee3be948426b0cf908aac8c3d91bcf57c10281e3b61abe0924311681e45c428e80da5db469da3964754c78539fd335e0a30a67b55e62'}
Dinaamagdy commented 5 years ago

and me on ops farm with the following zerotier network af78bf94369ec6cb and development branch

siddiquagig commented 5 years ago

Also getting error when creating VM:

In [1]: from  jumpscale import j

In [2]: node = j.clients.zos.get('08002712d169', data={'host':'10.102.191.168'})

In [3]: vm = node.primitives.create_virtual_machine('host-data_1', 'zero-os:development')

In [5]: vm.deploy()
---------------------------------------------------------------------------
ResultError                               Traceback (most recent call last)
/usr/local/bin/js_shell in <module>()
----> 1 vm.deploy()

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/sal_zos/vm/ZOS_VM.py in deploy(self)
    603         resp.raise_for_status()
    604         self.configs.add('ipxescript', '/boot/ipxe-script', resp.content.decode('utf-8'))
--> 605         super().deploy()
    606
    607     def to_dict(self):

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/sal_zos/vm/ZOS_VM.py in deploy(self)
    493     def deploy(self):
    494         if not self.is_running():
--> 495             self.start()
    496         else:
    497             # search for diskchanges

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/sal_zos/vm/ZOS_VM.py in start(self)
    382                 j.sal_zos.utils.authorize_zerotiers(publiczt, self.nics)
    383         self.node.client.kvm.create(self.name, media, self.flist, self.vcpus,
--> 384                                     self.memory, nics, ports, mounts, self.tags, config)
    385
    386     def load_from_reality(self):

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/clients/zero_os_protocol/KvmManager.py in create(self, name, media, flist, cpu, memory, nics, port, mount, tags, config, storage)
    218             raise ValueError('need at least one boot media via media or an flist')
    219
--> 220         return self._client.json('kvm.create', args, tags=tags)
    221
    222     def prepare_migration_target(self, uuid, nics=None, port=None, tags=None):

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/clients/zero_os_protocol/BaseClient.py in json(self, command, arguments, tags, id)
    123         :Return: Data
    124         """
--> 125         result = self.sync(command, arguments, tags=tags, id=id)
    126         if result.level != 20:
    127             raise RuntimeError('invalid result level, expecting json(20) got (%d)' % result.level)

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/clients/zero_os_protocol/BaseClient.py in sync(self, command, arguments, tags, id)
    113             if not result.code:
    114                 result.code = 500
--> 115             raise ResultError(msg='%s' % result.data, code=result.code)
    116
    117         return result

ResultError: "abnormal exit of filesystem mount at '/mnt/vms/3d11fa74-9a89-4e60-b5cd-eed741081f45'"

js branch: development

serboctor commented 5 years ago

@siddiquagig which flist are you using?

siddiquagig commented 5 years ago

@serboctor these:

BASEFLIST = 'https://hub.gig.tech/gig-bootable/{}.flist'
ZEROOSFLIST = "https://hub.gig.tech/gig-bootable/zero-os-bootable.flist"
serboctor commented 5 years ago

@siddiquagig only flist from here are supported https://hub.grid.tf/

Dina-Abd-Elrahman commented 5 years ago

while doing node_client.client.kvm.list(), it threw the following error

ResultError                               Traceback (most recent call last)
/usr/local/bin/js_shell in <module>()
----> 1 node.client.kvm.list()

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/clients/zero_os_protocol/KvmManager.py in list(self)
    517         :return:
    518         """
--> 519         return self._client.json('kvm.list', {})
    520 
    521     def create_image(self, file_name, size, format='qcow2'):

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/clients/zero_os_protocol/BaseClient.py in json(self, command, arguments, tags, id)
    123         :Return: Data
    124         """
--> 125         result = self.sync(command, arguments, tags=tags, id=id)
    126         if result.level != 20:
    127             raise RuntimeError('invalid result level, expecting json(20) got (%d)' % result.level)

/opt/code/github/threefoldtech/jumpscale_lib/JumpscaleLib/clients/zero_os_protocol/BaseClient.py in sync(self, command, arguments, tags, id)
    113             if not result.code:
    114                 result._code = 500
--> 115             raise ResultError(msg='%s' % result.data, code=result.code)
    116 
    117         return result

ResultError: 

so I tried to loop over all nodes and do that same thing, then report all nodes that throw the error

In [24]: kds_farm_nodes = [{'id': 'e0d55e6af8cd', 'ip': '10.102.132.23'},
    ...:  {'id': 'ac1f6b456cf4', 'ip': '10.102.234.243'},
    ...:  {'id': 'ac1f6b4571d0', 'ip': '10.102.201.133'},
    ...:  {'id': 'ac1f6b457630', 'ip': '10.102.178.130'},
    ...:  {'id': 'ac1f6b4573d4', 'ip': '10.102.147.99'},
    ...:  {'id': 'ac1f6b457344', 'ip': '10.102.191.143'},
    ...:  {'id': 'ac1f6b4571d8', 'ip': '10.102.117.236'},
    ...:  {'id': 'ac1f6b4571cc', 'ip': '10.102.104.231'},
    ...:  {'id': 'ac1f6b4575a8', 'ip': '10.102.234.229'},
    ...:  {'id': 'ac1f6b457338', 'ip': '10.102.71.171'},
    ...:  {'id': 'ac1f6b27243c', 'ip': '10.102.96.237'},
    ...:  {'id': 'ac1f6b4571c8', 'ip': '10.102.167.219'},
    ...:  {'id': 'ac1f6b2722e8', 'ip': '10.102.40.95'},
    ...:  {'id': 'ac1f6b272260', 'ip': '10.102.141.236'},
    ...:  {'id': 'ac1f6b2723a0', 'ip': '10.102.113.188'},
    ...:  {'id': 'ac1f6b272400', 'ip': '10.102.186.165'},
    ...:  {'id': 'ac1f6b456b98', 'ip': '10.102.114.69'},
    ...:  {'id': 'ac1f6b457488', 'ip': '10.102.64.213'},
    ...:  {'id': '08002785824a', 'ip': '10.0.2.15'},
    ...:  {'id': 'ac1f6b27224c', 'ip': '10.102.189.153'},
    ...:  {'id': 'ac1f6b272268', 'ip': '10.102.227.115'},
    ...:  {'id': 'ac1f6b272370', 'ip': '10.102.115.21'},
    ...:  {'id': 'ac1f6b2723e0', 'ip': '10.102.57.140'},
    ...:  {'id': 'ac1f6b272328', 'ip': '10.102.133.88'},
    ...:  {'id': '00e04c6805f2', 'ip': '172.29.51.96'},
    ...:  {'id': 'd4c9efce1672', 'ip': '172.29.121.238'},
    ...:  {'id': '00e04c68082c', 'ip': '10.102.223.247'},
    ...:  {'id': '00e04c6809dc', 'ip': '10.102.221.172'},
    ...:  {'id': '00e04c680a63', 'ip': '10.102.129.53'}]
    ...: 
    ...:  

In [25]: for node in kds_farm_nodes:
    ...:     node_client = j.clients.zos.get('x', data={'host':node['ip']})
    ...:     try:
    ...:         node_client.client.kvm.list()
    ...:     except:
    ...:         print(node)

    ...:         
{'ip': '10.102.40.95', 'id': 'ac1f6b2722e8'}
{'ip': '10.102.186.165', 'id': 'ac1f6b272400'}
{'ip': '10.0.2.15', 'id': '08002785824a'}
{'ip': '10.102.115.21', 'id': 'ac1f6b272370'}
{'ip': '172.29.51.96', 'id': '00e04c6805f2'}
{'ip': '172.29.121.238', 'id': 'd4c9efce1672'}
{'ip': '10.102.129.53', 'id': '00e04c680a63'}
Dina-Abd-Elrahman commented 5 years ago

jumpscaler version :

core : c5ba4a4d73fac0549fbc06354364584e47f2b05e lib : e71294eb9d3c64c666152c4e9662e83c3e76ae5d prefab : 44e92d0c9e47f663c1ede06e8d8c983905da581d

serboctor commented 5 years ago

I can't reach most of these nodes. And the one I was able to reach, I added my key and opened the port but still got permission denied when I tried to ssh to it. It is impossible to investigate without access to the logs.

Dinaamagdy commented 5 years ago

can't not reproduce