ec2: fix broken nixops check with NVMe #1075
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've noticed that
nixops check
is failing to recognize NVMe devices and shows them as un-attached all the time, then tries to re-attach them with eachnixops deploy
, here's an example:nix-shell:~/src/nixops-unstable]$ nixops check -d XXXXX Machines state: +----------+--------+-----+-----------+----------+----------------+-------+---------------------------------------------------------------+ | Name | Exists | Up | Reachable | Disks OK | Load avg. | Units | Notes | +----------+--------+-----+-----------+----------+----------------+-------+---------------------------------------------------------------+ | data0 | Yes | Yes | Yes | No | 1.65 1.80 1.32 | | volume ‘vol-0e386094f39e6d82a’ not attached to ‘/dev/nvme1n1’ | | frontend | Yes | Yes | Yes | No | 0.12 0.18 0.17 | | volume ‘vol-0b2aa0f4d7be9434b’ not attached to ‘/dev/nvme1n1’ | +----------+--------+-----+-----------+----------+----------------+-------+---------------------------------------------------------------+ Non machines resources state: +---------+--------+ | Name | Exists | +---------+--------+ | keypair | Yes | | sg | Yes | | role | Yes | +---------+--------+
[nix-shell:~/src/nixops-unstable]$ nixops deploy -d XXXXX frontend> warning: device ‘/dev/nvme1n1’ was manually detached! data0...> warning: device ‘/dev/nvme1n1’ was manually detached! frontend> attaching volume ‘vol-0b2aa0f4d7be9434b’ as ‘/dev/nvme1n1’... data0...> attaching volume ‘vol-0e386094f39e6d82a’ as ‘/dev/nvme1n1’... building all machine configurations... ^Cerror: interrupted error: interrupted by the user ^[[A [nix-shell:~/src/nixops-unstable]$
Using the device_name_to_boto_expected() function, it seems working for both 5th generation (NVMe) and older generation disks as it translates both device names 'xvdX' and 'nvmeXnX' to 'sdX'.