Previously, vhd images were tested using QEMU. This commit changes that to boot them in the actual Azure infrastructure. Azure VMs have quite a lot of dependencies - a network interface, a virtual network, a network security group, a public ip address and a disk. Azure CLI and Azure Portal handle the creation of all these resources internally. However, when using the API, the caller is responsible to create all these resources before creating an actual VM. To handle the creation of all the resources in the right order, a deployment is used. A deployment is a set of resources defined in a JSON document. It can optionally take parameters to customize each deployment. After the deployment is finished, the VM is up and ready to be tested using SSH. Sadly, the deployments are a bit hard to clean-up. One would expect that deleting a deployment removes all the deployed resources. However, it doesn't work this way and therefore it's needed to clean up all resources "manually". For this reason, our deployment sets a unique tag on all the resources created by the deployment. After this test is finished, the API is queried for all the resources with the tag and then, they're deleted in the right order.
213 lines
6.9 KiB
JSON
213 lines
6.9 KiB
JSON
{
|
|
"ami": {
|
|
"boot": {
|
|
"type": "aws"
|
|
},
|
|
"compose-request": {
|
|
"distro": "",
|
|
"arch": "",
|
|
"image-type": "ami",
|
|
"repositories": [],
|
|
"filename": "image.vhdx",
|
|
"blueprint": {}
|
|
}
|
|
},
|
|
"ext4-filesystem": {
|
|
"boot": {
|
|
"type": "nspawn"
|
|
},
|
|
"compose-request": {
|
|
"distro": "",
|
|
"arch": "",
|
|
"image-type": "ext4-filesystem",
|
|
"repositories": [],
|
|
"filename": "filesystem.img",
|
|
"blueprint": {
|
|
"name": "ext4-filesystem-boot-test",
|
|
"description": "Image for boot test",
|
|
"packages": [
|
|
{
|
|
"name": "openssh-server",
|
|
"version": "*"
|
|
}
|
|
],
|
|
"modules": [],
|
|
"groups": [],
|
|
"customizations": {
|
|
"user": [
|
|
{
|
|
"name": "redhat",
|
|
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"openstack": {
|
|
"boot": {
|
|
"type": "qemu"
|
|
},
|
|
"compose-request": {
|
|
"distro": "",
|
|
"arch": "",
|
|
"image-type": "openstack",
|
|
"repositories": [],
|
|
"filename": "disk.qcow2",
|
|
"blueprint": {
|
|
"name": "openstack-boot-test",
|
|
"description": "Image for boot test",
|
|
"packages": [],
|
|
"modules": [],
|
|
"groups": [],
|
|
"customizations": {
|
|
"user": [
|
|
{
|
|
"name": "redhat",
|
|
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"partitioned-disk": {
|
|
"boot": {
|
|
"type": "nspawn"
|
|
},
|
|
"compose-request": {
|
|
"distro": "",
|
|
"arch": "",
|
|
"image-type": "partitioned-disk",
|
|
"filename": "disk.img",
|
|
"repositories": [],
|
|
"blueprint": {
|
|
"name": "partitioned-disk-boot-test",
|
|
"description": "Image for boot test",
|
|
"packages": [],
|
|
"modules": [],
|
|
"groups": [],
|
|
"customizations": {
|
|
"user": [
|
|
{
|
|
"name": "redhat",
|
|
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tar": {
|
|
"boot": {
|
|
"type": "nspawn-extract"
|
|
},
|
|
"compose-request": {
|
|
"distro": "",
|
|
"arch": "",
|
|
"image-type": "tar",
|
|
"repositories": [],
|
|
"filename": "root.tar.xz",
|
|
"blueprint": {
|
|
"name": "tar-boot-test",
|
|
"description": "Image for boot test",
|
|
"packages": [
|
|
{
|
|
"name": "openssh-server",
|
|
"version": "*"
|
|
}
|
|
],
|
|
"modules": [],
|
|
"groups": [],
|
|
"customizations": {
|
|
"user": [
|
|
{
|
|
"name": "redhat",
|
|
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"qcow2": {
|
|
"boot": {
|
|
"type": "qemu"
|
|
},
|
|
"compose-request": {
|
|
"distro": "",
|
|
"arch": "",
|
|
"image-type": "qcow2",
|
|
"repositories": [],
|
|
"filename": "disk.qcow2",
|
|
"blueprint": {
|
|
"name": "qcow2-boot-test",
|
|
"description": "Image for boot test",
|
|
"packages": [],
|
|
"modules": [],
|
|
"groups": [],
|
|
"customizations": {
|
|
"user": [
|
|
{
|
|
"name": "redhat",
|
|
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"vhd": {
|
|
"boot": {
|
|
"type": "azure"
|
|
},
|
|
"compose-request": {
|
|
"distro": "",
|
|
"arch": "",
|
|
"image-type": "vhd",
|
|
"repositories": [],
|
|
"filename": "disk.vhd",
|
|
"blueprint": {
|
|
"name": "vhd-boot-test",
|
|
"description": "Image for boot test",
|
|
"packages": [],
|
|
"modules": [],
|
|
"groups": [],
|
|
"customizations": {
|
|
"user": [
|
|
{
|
|
"name": "redhat",
|
|
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"vmdk": {
|
|
"boot": {
|
|
"type": "qemu"
|
|
},
|
|
"compose-request": {
|
|
"distro": "",
|
|
"arch": "",
|
|
"image-type": "vmdk",
|
|
"filename": "disk.vmdk",
|
|
"blueprint": {
|
|
"name": "vmdk-boot-test",
|
|
"description": "Image for boot test",
|
|
"packages": [],
|
|
"modules": [],
|
|
"groups": [],
|
|
"customizations": {
|
|
"user": [
|
|
{
|
|
"name": "redhat",
|
|
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC61wMCjOSHwbVb4VfVyl5sn497qW4PsdQ7Ty7aD6wDNZ/QjjULkDV/yW5WjDlDQ7UqFH0Sr7vywjqDizUAqK7zM5FsUKsUXWHWwg/ehKg8j9xKcMv11AkFoUoujtfAujnKODkk58XSA9whPr7qcw3vPrmog680pnMSzf9LC7J6kXfs6lkoKfBh9VnlxusCrw2yg0qI1fHAZBLPx7mW6+me71QZsS6sVz8v8KXyrXsKTdnF50FjzHcK9HXDBtSJS5wA3fkcRYymJe0o6WMWNdgSRVpoSiWaHHmFgdMUJaYoCfhXzyl7LtNb3Q+Sveg+tJK7JaRXBLMUllOlJ6ll5Hod root@localhost"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|