From 4af15473c3bbac17360e596016de673869c6a7e3 Mon Sep 17 00:00:00 2001 From: Dawson Greeley <5050898+MrDaGree@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:07:51 +0000 Subject: [PATCH] fix(generate_migration_data): doesn't keep instance type Signed-off-by: Dawson Greeley --- pylxd/models/instance.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pylxd/models/instance.py b/pylxd/models/instance.py index f404e63f..49f174c0 100644 --- a/pylxd/models/instance.py +++ b/pylxd/models/instance.py @@ -644,6 +644,9 @@ def generate_migration_data(self, live=False): operation_url = self.client.api.operations[operation.id]._api_endpoint secrets = response.json()["metadata"]["metadata"] cert = self.client.host_info["environment"]["certificate"] + if self.config.get("volatile.vsock_id", False): + # Delete key/value for volatile.vsock_id as this will be different on new host. Throws an 'Unknown configuration key: volatile.vsock_id' error if we don't delete it + del self.config["volatile.vsock_id"] return { "name": self.name, @@ -651,7 +654,8 @@ def generate_migration_data(self, live=False): "config": self.config, "devices": self.devices, "epehemeral": self.ephemeral, - "default": self.profiles, + "profiles": self.profiles, + "type": self.type, "source": { "type": "migration", "operation": operation_url,