Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Add ability for Ignition to report provisioning failures #2444

Closed
cgonyeo opened this issue May 30, 2018 · 4 comments
Closed

Add ability for Ignition to report provisioning failures #2444

cgonyeo opened this issue May 30, 2018 · 4 comments

Comments

@cgonyeo
Copy link

cgonyeo commented May 30, 2018

Issue Report

Feature Request

Environment

All

Desired Feature

Some clouds (ex: packet.net provide the ability for a machine to report their state. Once Ignition fails, it should report this state to the cloud it's running on.

Other Information

internal/providers provides cloud-specific logic. An additional function could be added there that gets called when Ignition fails (pretty much identically to how the NewFetcher function there gets used). Packet seems like a good first choice for a cloud to do this on.

#2234 is related, but that suggests reporting to a user-provided URL whereas this is reporting to the APIs for the given cloud environment in which Ignition is running.

@bgilbert
Copy link
Contributor

See also #2042, #2130.

@Bubblemelon
Copy link

Bubblemelon commented Jun 5, 2018

In reference to https://www.packet.net/developers/api/devices/ by using a Packet Token and a Instance ID:

{
	"events": [
		{
			"id": "5430a5b8-3c0a-4fac-8234-8576e1c48277",
			"type": "provisioning.110",
			"body": "Provision complete! Your device is ready to go.",
			"state": null,
			"created_at": "2018-06-04T23:53:17Z",
			"relationships": [
				{
					"href": "#11e2ba60-0e9c-424f-a217-0ae2d9bda0f3"
				}
			],
			"ip": "147.75.200.3",
			"modified_by": {
				"id": "0ff7f54a-8999-4102-8c74-f64813ebc57c",
				"full_name": "Packet Bot",
				"avatar_url": "/users/0ff7f54a-8999-4102-8c74-f64813ebc57c/avatars/original?1519335086",
				"avatar_thumb_url": "/users/0ff7f54a-8999-4102-8c74-f64813ebc57c/avatars/thumb?1519335086"
			},
			"interpolated": "Provision complete! Your device is ready to go.",
			"href": "/events/5430a5b8-3c0a-4fac-8234-8576e1c48277"
		},
		{
			"id": "36f2e7b7-781f-4b75-97bc-bd580201d3c1",
			"type": "provisioning.104.01",
			"body": "Device connected to DHCP system",
			"state": null,
			"created_at": "2018-06-04T23:52:55Z",
			"relationships": [
				{
					"href": "#3b64a738-b95f-4b7d-be77-00f6f1b5813f"
				}
			],
			"ip": "147.75.200.3",
			"modified_by": {
				"id": "0ff7f54a-8999-4102-8c74-f64813ebc57c",
				"full_name": "Packet Bot",
				"avatar_url": "/users/0ff7f54a-8999-4102-8c74-f64813ebc57c/avatars/original?1519335086",
				"avatar_thumb_url": "/users/0ff7f54a-8999-4102-8c74-f64813ebc57c/avatars/thumb?1519335086"
			},
			"interpolated": "Device connected to DHCP system",
			"href": "/events/36f2e7b7-781f-4b75-97bc-bd580201d3c1"
		},
		{
			"id": "8bcf0f45-8c96-4660-a6de-99b1b44464c9",
			"type": "provisioning.103",
			"body": "Configuration written, restarting device",
			"state": null,
			"created_at": "2018-06-04T23:52:37Z",
			"relationships": [
				{
					"href": "#4ac18aad-eaa7-48ac-ba15-93233562e42a"
				}
			],
			"ip": null,
			"modified_by": null,
			"interpolated": "Configuration written, restarting device",
			"href": "/events/8bcf0f45-8c96-4660-a6de-99b1b44464c9"
		},
		{
			"id": "a0eeb86c-7266-4725-bb38-29e089cad433",
			"type": "provisioning.102",
			"body": "Network configured with addresses 147.75.70.223, 2604:1380:1000:500::7, and 10.88.2.135",
			"state": null,
			"created_at": "2018-06-04T23:52:27Z",
			"relationships": [
				{
					"href": "#99e9fb3e-cef4-4b88-a9c0-f78fb020d10b"
				}
			],
			"ip": null,
			"modified_by": null,
			"interpolated": "Network configured with addresses 147.75.70.223, 2604:1380:1000:500::7, and 10.88.2.135",
			"href": "/events/a0eeb86c-7266-4725-bb38-29e089cad433"
		},
		{
			"id": "15e0e49a-253c-490e-ac2d-0f1ec1b06b01",
			"type": "provisioning.101",
			"body": "Provisioning started",
			"state": null,
			"created_at": "2018-06-04T23:51:47Z",
			"relationships": [
				{
					"href": "#79f3f9cc-a65b-40fa-a122-b079d79e4de0"
				}
			],
			"ip": null,
			"modified_by": null,
			"interpolated": "Provisioning started",
			"href": "/events/15e0e49a-253c-490e-ac2d-0f1ec1b06b01"
		},
		{
			"id": "56afde7b-2faf-4a60-815e-527c79f3d81d",
			"type": "provisioning.100",
			"body": "Queued for provisioning",
			"state": null,
			"created_at": "2018-06-04T23:51:47Z",
			"relationships": [
				{
					"href": "#1056748b-b90d-44f8-903a-91ca523c4778"
				}
			],
			"ip": "12.133.141.2",
			"modified_by": {
				"id": "a4ed93de-1058-4b36-b7f2-67bcaaa6d5d9",
				"full_name": "Cheryl Fong",
				"avatar_url": "/users/a4ed93de-1058-4b36-b7f2-67bcaaa6d5d9/avatars/original?1527878746",
				"avatar_thumb_url": "/users/a4ed93de-1058-4b36-b7f2-67bcaaa6d5d9/avatars/thumb?1527878746"
			},
			"interpolated": "Queued for provisioning",
			"href": "/events/56afde7b-2faf-4a60-815e-527c79f3d81d"
		},
		{
			"id": "38ecce4f-96e7-49df-b237-5365df03b419",
			"type": "instance.created",
			"body": "\"%device%\" (t1.small.x86) was deployed to project \"%project%\" by %user%",
			"state": null,
			"created_at": "2018-06-04T23:51:47Z",
			"relationships": [
				{
					"href": "#6124662b-f459-4624-a1c4-45816b5e7376"
				},
				{
					"href": "#a0692ffe-4b4b-434c-82b4-b9223b32a360"
				},
				{
					"href": "#2ae4e5b4-6bd9-4d8b-ac4b-b4eca5486fad"
				},
				{
					"href": "#6a66f0c0-dfd7-4151-8476-563132ca9c99"
				}
			],
			"ip": "12.133.141.2",
			"modified_by": {
				"id": "a4ed93de-1058-4b36-b7f2-67bcaaa6d5d9",
				"full_name": "Cheryl Fong",
				"avatar_url": "/users/a4ed93de-1058-4b36-b7f2-67bcaaa6d5d9/avatars/original?1527878746",
				"avatar_thumb_url": "/users/a4ed93de-1058-4b36-b7f2-67bcaaa6d5d9/avatars/thumb?1527878746"
			},
			"interpolated": "\"kola-67b848e4-3fe2a5bd2a\" (t1.small.x86) was deployed to project \"CoreOS :: team-os\" by Cheryl",
			"href": "/events/38ecce4f-96e7-49df-b237-5365df03b419"
		}
	],
	"meta": {
		"first": {
			"href": "/devices/1f2b7f19-9dc3-44d8-a7d6-5a7c5bd12a9f/events?page=1"
		},
		"previous": null,
		"self": {
			"href": "/devices/1f2b7f19-9dc3-44d8-a7d6-5a7c5bd12a9f/events?page=1"
		},
		"next": null,
		"last": {
			"href": "/devices/1f2b7f19-9dc3-44d8-a7d6-5a7c5bd12a9f/events?page=1"
		},
		"current_page": 1,
		"last_page": 1,
		"total": 7
	}
}

The above is reflected on the "Timeline" tab of the "kola-6784...bd2a" server instance deployed through kola spawn -p packet --packet-config-file ~/.config/packet.json

My Question is: If state is not null, does it show up on the Event Log under the Timeline tab of a server instance?

I have tried running different OS servers just to see the difference in the Timeline and what the JSON field for state would look like. The ones I've deployed so far set state to null and do not show on Timeline > Event Log > Event Details.

Second Question: What Type should the Status property be in the Config struct of internal/oem/oem.go ? And will this be linked to the state key/field in the JSON file above?

@cgonyeo
Copy link
Author

cgonyeo commented Jun 5, 2018

For those following along at home, I talked to Cheryl in person and was able to answer her questions

@Bubblemelon Bubblemelon added the jira Makes a copy of an issue onto a Jira card. label Jun 8, 2018
@coreosbot
Copy link

Moved to coreos/ignition#592.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants