# Imaging - Davos Debug

<div id="bkmrk-lancer-davos-puis-fa">Launch Davos, then press CTRL+C  
  
From here, there are two options: Local connection or SSH</div><div id="bkmrk-connexion-locale%3A">  
Local connection:</div>```
# in the Davos console
sudo su
dpkg-reconfigure keyboard-configuration
systemctl restart keyboard-setup
python3
```

<div id="bkmrk-connexion-ssh%3Ad%27abor">  
SSH connection:  
First, retrieve the machine's IP address, then from the relay server:</div>```
ssh user@<IP>
```

<div id="bkmrk-%C2%A0mot-de-passe%3A-live"> Password: live</div>```
sudo su
python3
```

<div id="bkmrk-">  
</div>- To register the machine:

```
from davos import davosManager
from davos.inventory import Inventory

davos = davosManager()
inv = Inventory(davos)
#
# Enter the hostname in the input
# this will send the XML to pulse2-register-pxe
```

<div id="bkmrk--1">  
</div>```
print("mac address: {}".format(inv.macaddress))
print("ip address: {}".format(inv.ipaddress))
print("netmask: {}".format(inv.netmask))
print("disk : {}".format(inv.disk)) 
```

<div id="bkmrk--2">  
</div>```
# The inventory (unmodified) is located in:
less /tmp/inventory.xml
# There must be a missing / between tmp and macaddress, causing the file to be generated in /
/tmp<macaddress.xml
```

<div id="bkmrk--3">  
</div>- To debug the backup

```
from davos import davosManager
from davos.image_saver import imageSaver

davos = davosManager()
saver = imageSaver(davos)
saver.start()
```

<div id="bkmrk-enregistrer-la-sauve">Save the backup:</div>```
saver.imaging_api.imageDone(saver.manager.mac, saver.image_uuid)
```

<div id="bkmrk--4">  
</div>- To debug the restore:

```
from davos import davosManager
from davos.image_restorer import imageRestorer

davos = davosManager()
img = imageRestorer(davos, "unicast") 
```

<div id="bkmrk-pour-lancer-une-rest">To start a full restore:</div>```
img.start()
```

<div id="bkmrk-pour-lancer-uniqueme">To run only the post-installs</div>```
img.run_postimaging()
```

<div id="bkmrk-les-logs-de-davos-so">The Davos logs are located in:  
</div>```
/var/log/davos.log
/var/log/davos_restorer.log
```

<div id="bkmrk-les-logs-des-postins">  
The post-install logs are located in:  
</div>```
/tmp/postinst.xxx.log
```

<div id="bkmrk-les-postinstalls-son">  
Postinstalls are located in /imaging_server/masters/&lt;master_uuid&gt;/postinst.d/  
 The master UUID can be retrieved from the imaging.Image table in the database.</div>